mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14733 from ahrtr/rev_inconsistency_3.5
[3.5] etcdserver: call the OnPreCommitUnsafe in unsafeCommit
This commit is contained in:
commit
5f387e6b7d
@ -329,10 +329,6 @@ func (t *batchTxBuffered) CommitAndStop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *batchTxBuffered) commit(stop bool) {
|
func (t *batchTxBuffered) commit(stop bool) {
|
||||||
if t.backend.hooks != nil {
|
|
||||||
t.backend.hooks.OnPreCommitUnsafe(t)
|
|
||||||
}
|
|
||||||
|
|
||||||
// all read txs must be closed to acquire boltdb commit rwlock
|
// all read txs must be closed to acquire boltdb commit rwlock
|
||||||
t.backend.readTx.Lock()
|
t.backend.readTx.Lock()
|
||||||
t.unsafeCommit(stop)
|
t.unsafeCommit(stop)
|
||||||
@ -340,6 +336,9 @@ func (t *batchTxBuffered) commit(stop bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *batchTxBuffered) unsafeCommit(stop bool) {
|
func (t *batchTxBuffered) unsafeCommit(stop bool) {
|
||||||
|
if t.backend.hooks != nil {
|
||||||
|
t.backend.hooks.OnPreCommitUnsafe(t)
|
||||||
|
}
|
||||||
if t.backend.readTx.tx != nil {
|
if t.backend.readTx.tx != nil {
|
||||||
// wait all store read transactions using the current boltdb tx to finish,
|
// wait all store read transactions using the current boltdb tx to finish,
|
||||||
// then close the boltdb tx
|
// then close the boltdb tx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user