-
Notifications
You must be signed in to change notification settings - Fork 312
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
feat(dup): write pegasus value in new data version for duplication #459
Conversation
uint64_t local_timetag = | ||
pegasus_extract_timetag(_pegasus_data_version, get_ctx.raw_value); | ||
|
||
if (local_timetag >= new_timetag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果timestamp和cluster id相同,remove操作优先于put?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
热备份暂时不考虑 remove,remove 的一致性判断比较复杂
{ | ||
struct test_case | ||
{ | ||
int value_schema_version; | ||
|
||
uint32_t expire_ts; | ||
uint64_t timetag; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个用TEST_P刚好适合
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后面的PR会改,这个PR优先考虑让diff最小。
What problem does this PR solve?
Duplication requires "timetag" to be encoded in value for "master-master" write-conflict resolution.
This PR introduces a read-before-write mechanism on every duplicated write.
What is changed and how it works?
For our read-before-write implementation, we read the record from RocksDB and decodes its timetag. If new timetag in duplicated write is larger than the old timetag, this duplicated write can be applied. Otherwise, the duplicate will be ignored.
Check List
Tests
Code changes
Side effects
Related changes