Skip to content

fix(flatkv): sync SNAPSHOT_BASE on WriteSnapshot to avoid unnecessary WAL catchup on restart#3011

Merged
blindchaser merged 5 commits intomainfrom
yiren/fix-base
Mar 4, 2026
Merged

fix(flatkv): sync SNAPSHOT_BASE on WriteSnapshot to avoid unnecessary WAL catchup on restart#3011
blindchaser merged 5 commits intomainfrom
yiren/fix-base

Conversation

@blindchaser
Copy link
Contributor

Describe your changes and provide context

Testing performed to validate your change

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 4, 2026, 4:46 PM

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 665854e8d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

commitStorageEntry(t, s, Address{0xF0}, Slot{0x02}, []byte{0x02})
require.NoError(t, s.WriteSnapshot(""))

flatkvDir := filepath.Join(dir, "data", flatkvRootDir)

Choose a reason for hiding this comment

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

P2 Badge Use the correct FlatKV root in snapshot-base test

TestWriteSnapshotUpdatesSnapshotBase initializes the store with NewCommitStore(dir, ...), but then reads SNAPSHOT_BASE from filepath.Join(dir, "data", flatkvRootDir, ...); NewCommitStore uses the provided dbDir directly (see store.go), so this path points to the wrong location and the read will fail with ENOENT, meaning the new regression test does not validate the behavior it intends to cover.

Useful? React with 👍 / 👎.

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.28%. Comparing base (dcf5a0e) to head (6ceb6c9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/state_db/sc/flatkv/snapshot.go 20.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3011      +/-   ##
==========================================
- Coverage   58.39%   58.28%   -0.12%     
==========================================
  Files        2109     2108       -1     
  Lines      174936   173733    -1203     
==========================================
- Hits       102161   101266     -895     
+ Misses      63758    63438     -320     
- Partials     9017     9029      +12     
Flag Coverage Δ
sei-chain-pr 61.45% <20.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-db/state_db/sc/flatkv/snapshot.go 66.16% <20.00%> (-0.71%) ⬇️

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blindchaser blindchaser enabled auto-merge (squash) March 4, 2026 00:34
@blindchaser blindchaser merged commit 662d751 into main Mar 4, 2026
39 checks passed
@blindchaser blindchaser deleted the yiren/fix-base branch March 4, 2026 16:59
yzang2019 pushed a commit that referenced this pull request Mar 19, 2026
… WAL catchup on restart (#3011)

## Describe your changes and provide context

## Testing performed to validate your change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants