Skip to content

Fix non-contiguous ledger after join from snapshot with copied in-progress chunk (#7871)#7872

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/build-hypotheses-and-test
Draft

Fix non-contiguous ledger after join from snapshot with copied in-progress chunk (#7871)#7872
Copilot wants to merge 3 commits intomainfrom
copilot/build-hypotheses-and-test

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

Fix for #7871 (reconfiguration.test_ledger_invariants failure: non-contiguous chunks after join from snapshot when target had an in-progress chunk).

  • In Ledger::init(idx, ...), promote any recovered writable file whose entries are entirely ≤ idx to .committed before clearing the in-memory list, so the on-disk ledger is contiguous up to the snapshot seqno.
  • Add unit test in src/host/test/ledger.cpp reproducing the scenario (writable file present at init).
  • Add CHANGELOG entry under [7.0.3]Fixed (with PR number reference).
  • Build & run unit tests (ledger_test 17/17 pass, files_cleanup_test 38/38 pass).
  • Apply scripts/check-format.sh (clang-format-18) to changed C++ files.

Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/08d9f13b-0ab6-41e3-b8d0-b46dc31f2fd9

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
@achamayou
Copy link
Copy Markdown
Member

@copilot fix the code formatting and try again

Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/d609704c-2eb9-497d-a2fb-1324583fe76a

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot fix the code formatting and try again

Ran scripts/check-format.sh -f over the changed C++ files; only one line in src/host/test/ledger.cpp needed re-wrapping. Fixed in 0639d1d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-long-test Run Long Test job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants