[server] Update remote log offsets before local segment cleanup - #4254
[server] Update remote log offsets before local segment cleanup#4254loserwang1024 wants to merge 2 commits into
Conversation
d155b78 to
b63f1c3
Compare
| // deletes the local segment containing offset 25. | ||
| logTablet.updateRemoteLogEndOffset(40L, 40L); | ||
| assertThat(logTablet.localLogStartOffset()).isEqualTo(30L); | ||
| assertThat(logTablet.canFetchFromRemoteLog(25L)).isTrue(); |
There was a problem hiding this comment.
Here we checked the final state after updateRemoteLogEndOffset. It can't check whether we have the correct update processing order. We must 1) update copied watermark first then 2) delete local segment.
The problem is even if we first do operation 2 then 1, this test will also pass.
There was a problem hiding this comment.
t's hard to test this unless we add a hook before cleanupSegments, which is too intrusive to the production code.
b63f1c3 to
a496a31
Compare
|
@loserwang1024 would it be better to update remote log offset in one single function? (e.g. This is not a blocker either, just a code optimization. |
Purpose
Linked issue: close #4247
Brief change log
Tests
API and Format
Documentation