-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix: channel meta mergeFlushSegment not idempotent cause data loss #31837
Conversation
…pacted segment buffer data loss Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
@aoiasd Please associate the related pr of master to the body of your Pull Request. (eg. “pr: #”) |
/kind branch-feature |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.3 #31837 +/- ##
==========================================
+ Coverage 82.44% 82.45% +0.01%
==========================================
Files 838 848 +10
Lines 123914 124006 +92
==========================================
+ Hits 102159 102252 +93
- Misses 18486 18489 +3
+ Partials 3269 3265 -4
|
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.
@aoiasd
lgtm, but we need more unit tests here
@@ -697,6 +697,12 @@ func (c *ChannelMeta) mergeFlushedSegments(ctx context.Context, seg *Segment, pl | |||
|
|||
c.segMu.Lock() | |||
defer c.segMu.Unlock() | |||
|
|||
if _, ok := c.segments[seg.segmentID]; ok { | |||
log.Info("merge flushed segments exist, return") |
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.
better to print the segmentID here
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.
segment id is included in L691
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aoiasd, xiaofan-luan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix channel meta mergeFlushSegment not idempotent may cause data loss when update compacted segment buffer, because may update buffer to segment which has been covered.
relate: #31548