mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

One txn is treated as atomic, and might contain multiple Put/Delete/Range operations. For now, between these operations, we might call forecCommit to sync the change to disk, or backend may commit it in background. Thus the snapshot state might contains an unfinished multiple objects transaction, which is dangerous if database is restored from the snapshot. This PR makes KV txn hold batchTx lock during the process and avoids commit to happen.