Skip to content

Conversation

okhoshi
Copy link
Contributor

@okhoshi okhoshi commented May 9, 2025

What problem are we solving?

NeedleHeaderSize happens to have the same size as NeedleMapEntrySize, except when running the 5 bytes offset variant of Seaweedfs, because it does not contain OffsetSize. This causes ECX corruption on deletes, due to the drifting offset computation (offset is always computed on a basis of 16 bytes per record instead of 17 bytes).

How are we solving the problem?

Using the correct constant.

How is the PR tested?

None for now

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

…mSortedIndex

NeedleHeaderSize happen to have the same size as NeedleMapEntrySize, except when running the 5 bytes offset variant of Seaweedfs, because it does not contain OffsetSize. This causes ECX corruption on deletes, due to the drifting offset computation (offset is always computed on a basis of 16 bytes per record instead of 17 bytes)

Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
@chrislusf chrislusf merged commit 2ae5b48 into seaweedfs:master May 9, 2025
7 checks passed
@chrislusf
Copy link
Collaborator

Thanks! This is an important fix!

@kmlebedev
Copy link
Contributor

kmlebedev commented May 9, 2025

@okhoshi @chrislusf What did this bug affect? ​​How did you notice it? What problem does it solve?
Did this only affect EC volumes?

@chrislusf
Copy link
Collaborator

Affects EC volumes with deletes on the large_disk version.

@okhoshi
Copy link
Contributor Author

okhoshi commented May 9, 2025

We did notice the hard way, after ECX files were corrupted and reads and deletions were failing in weird ways. It indeed only affects EC volumes, only with the large_disk version, and when they receives deletes.

@okhoshi okhoshi deleted the fix-ec-search-needle-on-5bytes-offset branch May 9, 2025 16:42
BenoitKnecht pushed a commit to BenoitKnecht/seaweedfs that referenced this pull request May 15, 2025
…mSortedIndex (seaweedfs#6771)

NeedleHeaderSize happen to have the same size as NeedleMapEntrySize, except when running the 5 bytes offset variant of Seaweedfs, because it does not contain OffsetSize. This causes ECX corruption on deletes, due to the drifting offset computation (offset is always computed on a basis of 16 bytes per record instead of 17 bytes)

Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
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.

3 participants