-
Notifications
You must be signed in to change notification settings - Fork 9.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 panic during defrag operation #7579
Conversation
mvcc/backend/backend.go
Outdated
return tx | ||
} | ||
|
||
func (b *backend) unsafebegin(write bool) *bolt.Tx { |
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.
unsafeBegin
?
mvcc/backend/batch_tx.go
Outdated
t.unsafecommit(stop) | ||
} | ||
|
||
func (t *batchTxBuffered) unsafecommit(stop bool) { |
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.
unsafeCommit
?
@gyuho fix the patches? the test patch has backend changes |
defer clus.Terminate(t) | ||
|
||
cli := clus.RandClient() | ||
kvc := toGRPC(cli).KV |
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.
is there a reason not to use cli
directly for Put()
and Defragment()
?
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.
yes, the ./integration/ tests should use pure grpc interfaces when possible
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.
got it, thanks.
Fix etcd-io#7526. When resetting `bolt.Tx` in `defrag` and `batchTxBuffered.commit` operation, we do not hold `readTx` lock, so the inflight range requests can trigger panic in `mvcc.Range` paths. This fixes by moving mutexes out and hold it while resetting the `readTx`. Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
@xiang90 Yes. Will redeploy after merge. |
When resetting
bolt.Tx
indefrag
andbatchTxBuffered.commit
operation, we do not holdreadTx
lock, so the inflight range requests can trigger panic inmvcc.Range
paths. This fixes by moving mutexes out and hold it while resetting thereadTx
.The test case is added (fails in current master branch).