Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make write batch aotmic under txn sys #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

letterbeezps
Copy link
Contributor

@letterbeezps letterbeezps commented Aug 5, 2024

Put data one by one makes WAL's atomicity ineffective. A batch of data modified by the same transaction should be regarded as a whole.

Copy link
Owner

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

While this looks like a valid fix, the original code is correct. If we think about how txn are used: the read_ts is always less than the txn to-be-committed, so no txn can actually read these new data. Note that we bump the commit ts at the end of the write.

I'll merge the fix and also add a new test-your-understanding question in the book.

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.

2 participants