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

Set backend to cindex before recovering the lessor in applySnapshot #13930

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Apr 12, 2022

Fix 13922.

Copy the comment I added in the source code here so as save the effort to explain again:


	// We need to set the backend to consistIndex before recovering the lessor,
	// because lessor.Recover will commit the boltDB transaction, accordingly it
	// will get the old consistent_index persisted into the db in OnPreCommitUnsafe.
	// Eventually the new consistent_index value coming from snapshot is overwritten
	// by the old value.

@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2022

Codecov Report

Merging #13930 (484d2f0) into main (dd08e15) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main   #13930      +/-   ##
==========================================
+ Coverage   72.51%   72.57%   +0.06%     
==========================================
  Files         469      469              
  Lines       38411    38411              
==========================================
+ Hits        27853    27878      +25     
+ Misses       8778     8755      -23     
+ Partials     1780     1778       -2     
Flag Coverage Δ
all 72.57% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/etcdserver/server.go 84.54% <100.00%> (ø)
raft/rafttest/node.go 95.00% <0.00%> (-5.00%) ⬇️
server/etcdserver/api/v3rpc/watch.go 83.55% <0.00%> (-3.03%) ⬇️
client/pkg/v3/transport/listener.go 57.18% <0.00%> (-2.40%) ⬇️
server/auth/store.go 85.76% <0.00%> (-0.34%) ⬇️
server/etcdserver/v3_server.go 78.17% <0.00%> (+0.17%) ⬆️
raft/raft.go 90.42% <0.00%> (+0.24%) ⬆️
client/v3/leasing/kv.go 90.69% <0.00%> (+0.33%) ⬆️
pkg/proxy/server.go 61.01% <0.00%> (+0.33%) ⬆️
client/v3/watch.go 93.37% <0.00%> (+0.40%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd08e15...484d2f0. Read the comment docs.

@ahrtr
Copy link
Member Author

ahrtr commented Apr 12, 2022

cc @ptabor @serathius @spzala

@ahrtr
Copy link
Member Author

ahrtr commented Apr 12, 2022

Will backport to 3.5, once it's merged.

Copy link
Contributor

@ptabor ptabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome catch !!!

Copy link
Member

@serathius serathius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that this addresses the issue, awesome work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Verification error in TestV3WatchRestoreSnapshotUnsync
4 participants