Extract extent list reading for deleted checkpoints into helper function

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0, 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: Checkpoints
    • None

      Lines 653-690 of __ckpt_process iterate through checkpoints marked for deletion and read their extent lists from disk. This is a coherent operation that can be extracted into a helper function. The logic handles reading extent lists for both the checkpoint being deleted and the "next" checkpoint into which it will be merged, with special handling for tiered storage (non-local checkpoints). Extracting this reduces the main function's branching and improves readability.

      Files to change

      • src/block/block_ckpt.c — extract extent list reading logic into helper function

      Tasks

      • [ ] Create __ckpt_read_deletion_extlists(session, block, ckptbase, deleting_out) that iterates through ckptbase and reads extent lists (criterion: function populates bpriv fields and sets deleting flag)
      • [ ] Handle tiered storage checkpoint skipping (non-local checkpoints) (criterion: function continues to next checkpoint when local == false)
      • [ ] Refactor __ckpt_process to call the helper (criterion: lines 653-690 are replaced by a single function call)
      • [ ] Measure complexity before and after: lizard src/block/block_ckpt.c 2>/dev/null || python3 -m lizard src/block/block_ckpt.c 2>/dev/null (criterion: CCN for __ckpt_process dropped by ≥4)
      • [ ] Run existing block manager unit tests (criterion: ctest --test-dir build -R block passes)

      Definition of Done

      • [ ] New static function __ckpt_read_deletion_extlists handles reading extent lists for checkpoints marked for deletion
      • [ ] Function sets the deleting flag and reads extent lists for both the checkpoint to delete and the next checkpoint
      • [ ] Non-local (tiered) checkpoints are skipped as before
      • [ ] __ckpt_process calls this helper instead of inline logic at lines 653-690
      • [ ] Cyclomatic complexity of __ckpt_process is reduced by at least 4-6 points (measured with lizard src/block/block_ckpt.c 2>/dev/null || python3 -m lizard src/block/block_ckpt.c 2>/dev/null)
      • [ ] All existing tests pass (run ctest --test-dir build -R block -j$(nproc))
      • [ ] Code formatted with cd dist && ./s_clang_format

            Assignee:
            Etienne Petrel
            Reporter:
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: