Skip to content

feat: add progress reporting to fsck command [backport #996] - #997

Merged
kalbasit merged 1 commit into
release-0.9from
backport-996-to-release-0.9
Mar 1, 2026
Merged

kalbasit merged 1 commit into
release-0.9from
backport-996-to-release-0.9

Conversation

@kalbasit

@kalbasit kalbasit commented Mar 1, 2026

Copy link
Copy Markdown
Owner

Bot-based backport to release-0.9, triggered by a label in #996.

Add background progress ticker and per-step logging to fsck command for long-running operations. Users can now track progress every 30 seconds during suspect collection (Phase 1) and re-verification (Phase 2).

Progress tracking includes:

  • Items checked and suspects found (updated every 30s)
  • Percentage complete when total is known
  • Check rate (items/second)
  • Per-step completion messages with counts

Phase 1 (suspect collection) now logs:

  • phase 1a: narinfos_without_nar_files found
  • phase 1c: walking NAR storage / indexed NARs / checking nar_files / done checking nar_files
  • phase 1d: checking storage NAR files / done checking storage NAR files
  • phase 1e-g: CDC-specific checks

Phase 2 (re-verification) logs start with total suspects and periodic progress updates.

Co-Authored-By: Claude Haiku 4.5 [email protected]

Add background progress ticker and per-step logging to fsck command for
long-running operations. Users can now track progress every 30 seconds
during suspect collection (Phase 1) and re-verification (Phase 2).

Progress tracking includes:
- Items checked and suspects found (updated every 30s)
- Percentage complete when total is known
- Check rate (items/second)
- Per-step completion messages with counts

Phase 1 (suspect collection) now logs:
- phase 1a: narinfos_without_nar_files found
- phase 1c: walking NAR storage / indexed NARs / checking nar_files / done checking nar_files
- phase 1d: checking storage NAR files / done checking storage NAR files
- phase 1e-g: CDC-specific checks

Phase 2 (re-verification) logs start with total suspects and periodic
progress updates.

---------

Co-authored-by: Claude Haiku 4.5 <[email protected]>
(cherry picked from commit 37d08fc)
@kalbasit
kalbasit enabled auto-merge (squash) March 1, 2026 04:17
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request go Pull requests that update go code labels Mar 1, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user experience of the fsck command by integrating comprehensive progress reporting. It introduces a background ticker that periodically logs the status of the fsck process, breaking down progress by phase and providing key metrics such as items checked, total items, and processing rate. This enhancement allows users to monitor the command's execution more effectively, especially for operations that can take a considerable amount of time, offering transparency into its current state and estimated completion.

Highlights

  • Progress Reporting for fsck Command: Implemented a background progress ticker for the fsck command, providing real-time updates every 30 seconds during long-running operations like suspect collection (Phase 1) and re-verification (Phase 2).
  • Detailed Phase 1 Logging: Enhanced logging for Phase 1 (suspect collection) to include specific messages for sub-phases (1a-1g), detailing counts of narinfos_without_nar_files, orphaned nar_files in DB, NAR storage walking, and checks for chunk issues.
  • Phase 2 Re-verification Progress: Introduced progress tracking for Phase 2 (re-verification), logging total suspects and periodic updates on checked and remaining items.
  • Metrics Displayed: Progress updates now include items checked, total items (when known), suspects found, percentage complete, and check rate (items/second).
Changelog
  • pkg/ncps/fsck.go
    • Imported the sync/atomic package for concurrent safe counters.
    • Initialized zerolog.Ctx(ctx) to obtain a logger instance within collectFsckSuspects and reVerifyFsckSuspects.
    • Added atomic counters (checked, total, suspects, remaining) to track progress across different fsck phases.
    • Integrated startProgressTicker to periodically log progress updates for both Phase 1 (suspect collection) and Phase 2 (re-verification).
    • Added detailed logger.Info() messages at the start and completion of various fsck sub-phases (1a, 1b, 1c, 1d, 1e, 1f, 1g) with relevant counts.
    • Modified collectNarFilesWithChunkIssues and collectOrphanedChunksInStorage functions to accept an *atomic.Int64 pointer to update the checked count.
    • Implemented startProgressTicker function to manage a background goroutine for timed logging.
    • Created logProgress helper function to format and log common progress fields like checked items, total items, percentage, and rate.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@dosubot

dosubot Bot commented Mar 1, 2026

Copy link
Copy Markdown

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces progress reporting for the fsck command, which is a great enhancement for long-running operations. The implementation uses a background ticker and atomic counters to provide periodic updates during suspect collection and re-verification phases. The code is generally well-structured and the new logging provides valuable insight into the command's progress. I've identified one issue where the total count for progress calculation is based on incorrect assumptions, which could lead to a misleading percentage display. My specific comment provides a suggestion to address this.

Comment thread pkg/ncps/fsck.go Resolved
@codecov

codecov Bot commented Mar 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.04%. Comparing base (41bbf75) to head (43093b1).
⚠️ Report is 1 commits behind head on release-0.9.

Additional details and impacted files
@@             Coverage Diff             @@
##           release-0.9    #997   +/-   ##
===========================================
  Coverage         5.04%   5.04%           
===========================================
  Files                6       6           
  Lines              436     436           
===========================================
  Hits                22      22           
  Misses             410     410           
  Partials             4       4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kalbasit
kalbasit merged commit e7719e1 into release-0.9 Mar 1, 2026
17 of 20 checks passed
@kalbasit
kalbasit deleted the backport-996-to-release-0.9 branch March 1, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant