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: Verify sync task target segment and retry if not match #30500

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

congqixia
Copy link
Contributor

See also #27675 #30469

For a sync task, the segment could be compacted during sync task. In previous implementation, this sync task will hold only the old segment id as KeyLock, in which case compaction on compacted to segment may run in parallel with delta sync of this sync task.

This PR introduces sync target segment verification logic. It shall check target segment lock it's holding beforing actually syncing logic. If this check failed, sync task shall returnerrTargetSegementNotMatch error and make manager re-fetch the current target segment id.

See also milvus-io#30469

For a sync task, the segment could be compacted during sync task. In
previous implementation, this sync task will hold only the old segment
id as KeyLock, in which case compaction on compacted to segment may run
in parallel with delta sync of this sync task.

This PR introduces sync target segment verification logic. It shall
check target segment lock it's holding beforing actually syncing logic.
If this check failed, sync task shall return`errTargetSegementNotMatch`
error and make manager re-fetch the current target segment id.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
@sre-ci-robot sre-ci-robot requested review from sunby and zwd1208 February 4, 2024 08:19
@sre-ci-robot sre-ci-robot added size/L Denotes a PR that changes 100-499 lines. area/compilation labels Feb 4, 2024
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia

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

@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Feb 4, 2024
Copy link

codecov bot commented Feb 4, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (da50fbf) 80.15% compared to head (b3c2ac6) 80.14%.
Report is 5 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #30500      +/-   ##
==========================================
- Coverage   80.15%   80.14%   -0.02%     
==========================================
  Files         966      966              
  Lines      136844   136882      +38     
==========================================
+ Hits       109693   109708      +15     
- Misses      23432    23452      +20     
- Partials     3719     3722       +3     
Files Coverage Δ
internal/datanode/syncmgr/key_lock_dispatcher.go 82.35% <ø> (-17.65%) ⬇️
internal/datanode/syncmgr/task.go 100.00% <100.00%> (ø)
internal/datanode/syncmgr/sync_manager.go 90.58% <86.36%> (-2.17%) ⬇️

... and 17 files with indirect coverage changes

@mergify mergify bot added the ci-passed label Feb 4, 2024
@XuanYang-cn
Copy link
Contributor

/lgtm

@sre-ci-robot sre-ci-robot merged commit a68b321 into milvus-io:master Feb 5, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/compilation ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug lgtm size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants