Skip to content

fix(rollout): make WAL time trigger a true OR with count trigger#147

Merged
beinan merged 1 commit into
mainfrom
worktree-wal-merge-fix
Jul 15, 2026
Merged

fix(rollout): make WAL time trigger a true OR with count trigger#147
beinan merged 1 commit into
mainfrom
worktree-wal-merge-fix

Conversation

@beinan

@beinan beinan commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The periodic time-based WAL cleanup was gated by a second count threshold (cleanup_min_generations), so "interval elapsed" would not merge unless enough generations had also accumulated. That turned the intended "time OR count, whichever fires first" trigger into an AND — a shard whose 5-minute interval elapsed but stayed below the count threshold never merged back into the base table.
  • Fix: the time trigger is now unconditional on count. cleanup_own_shard merges whatever is pending (>=1 generation) the moment a pass runs.
  • Removed the now-obsolete cleanup_min_generations option, the rollout_cleanup_min_generations server config, and the ROLLOUT_CLEANUP_MIN_GENERATIONS env/CLI flag. The count trigger (merge_after_generations) is unchanged; the two triggers are now a strict OR.

Test plan

  • cargo build -p lance-context-core -p lance-context-server
  • cargo test -p lance-context-core --lib rollout (17 passed)
  • cargo test -p lance-context-server (39 passed)
  • Rewrote cleanup_own_shard_merges_only_at_min_generationscleanup_own_shard_merges_whatever_is_pending, asserting a single pending generation is merged on the next pass regardless of count.

🤖 Generated with Claude Code

The periodic time-based WAL cleanup was gated by a second count
threshold (cleanup_min_generations), so "interval elapsed" would not
merge unless enough generations had also accumulated. That turned the
intended "time OR count, whichever fires first" trigger into an AND:
a shard whose interval elapsed but stayed below the count threshold
never merged.

Make the time trigger unconditional on count: cleanup_own_shard now
merges whatever is pending (>=1 generation) the moment a pass runs.
Remove the cleanup_min_generations option, the
rollout_cleanup_min_generations server config, and the
ROLLOUT_CLEANUP_MIN_GENERATIONS env/CLI flag. The count trigger
(merge_after_generations) is unchanged; the two are now a strict OR.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@beinan beinan merged commit fa3208c into main Jul 15, 2026
9 checks passed
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.

1 participant