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

fix: channel meta mergeFlushSegment not idempotent cause data loss #31837

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

aoiasd
Copy link
Contributor

@aoiasd aoiasd commented Apr 2, 2024

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

…pacted segment buffer data loss

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
@sre-ci-robot sre-ci-robot added the size/XS Denotes a PR that changes 0-9 lines. label Apr 2, 2024
Copy link
Contributor

mergify bot commented Apr 2, 2024

@aoiasd Please associate the related pr of master to the body of your Pull Request. (eg. “pr: #”)

@mergify mergify bot added the kind/bug Issues or changes related a bug label Apr 2, 2024
@yanliang567 yanliang567 added this to the 2.3.13 milestone Apr 2, 2024
@congqixia
Copy link
Contributor

/kind branch-feature

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 82.45%. Comparing base (47f767c) to head (fda2c51).
Report is 2 commits behind head on 2.3.

Additional details and impacted files

Impacted file tree graph

@@            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     
Files Coverage Δ
internal/datanode/channel_meta.go 91.88% <20.00%> (-0.56%) ⬇️

... and 170 files with indirect coverage changes

Copy link
Contributor

@congqixia congqixia left a 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")
Copy link
Contributor

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

Copy link
Contributor

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

@xiaofan-luan
Copy link
Contributor

/lgtm
/approve

@sre-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@xiaofan-luan xiaofan-luan merged commit 4752c02 into milvus-io:2.3 Apr 3, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-passed DCO check passed. kind/branch-feature kind/bug Issues or changes related a bug lgtm size/XS Denotes a PR that changes 0-9 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants