Skip to content

fix: more server logs for snapshot export#7160

Merged
hanabi1224 merged 1 commit into
mainfrom
hm/chain-export-logs
Jun 10, 2026
Merged

fix: more server logs for snapshot export#7160
hanabi1224 merged 1 commit into
mainfrom
hm/chain-export-logs

Conversation

@hanabi1224

@hanabi1224 hanabi1224 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

It should be useful to track snapshot export progress on the server side, to troubleshoot transient stuckness issue.

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Chores
    • Enhanced logging for snapshot export operations with duration tracking and frame count reporting during write operations.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e2ceff79-eb3a-44e6-9a4a-17ec5c32c385

📥 Commits

Reviewing files that changed from the base of the PR and between 0ad035e and ba3c9e4.

📒 Files selected for processing (2)
  • src/chain/mod.rs
  • src/db/car/forest.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • filecoin-project/lotus (manual)

Walkthrough

This PR adds observability instrumentation to snapshot export operations. The export_to_forest_car function now measures export duration and logs initial parameters, while the CAR frame encoder tracks frame counts and emits progress logs for each export stage.

Changes

Snapshot Export Observability

Layer / File(s) Summary
Export-level timing instrumentation
src/chain/mod.rs
export_to_forest_car captures Instant::now() at the start, logs epoch, lookup depth, and prefix-frame count, then logs the total elapsed export duration formatted via humantime::format_duration after completion.
CAR frame writing progress logging
src/db/car/forest.rs
Encoder::write maintains an n_frames counter incremented per zstd frame, and emits tracing::info! logs after completing zstd CAR frame writes, skip-frame index writes, and footer serialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • LesnyRumcajs
  • sudo-shashank
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding logging for snapshot export operations in two files to track export progress and duration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hm/chain-export-logs
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/chain-export-logs

Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 marked this pull request as ready for review June 10, 2026 15:40
@hanabi1224 hanabi1224 requested a review from a team as a code owner June 10, 2026 15:40
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and sudo-shashank and removed request for a team June 10, 2026 15:40
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.32%. Comparing base (0ad035e) to head (ba3c9e4).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/chain/mod.rs 50.00% 3 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/db/car/forest.rs 84.10% <100.00%> (+0.23%) ⬆️
src/chain/mod.rs 83.47% <50.00%> (-1.85%) ⬇️

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ad035e...ba3c9e4. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hanabi1224 hanabi1224 added this pull request to the merge queue Jun 10, 2026
Merged via the queue into main with commit 97633aa Jun 10, 2026
58 of 61 checks passed
@hanabi1224 hanabi1224 deleted the hm/chain-export-logs branch June 10, 2026 23:43
@coderabbitai coderabbitai Bot mentioned this pull request Jun 12, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants