mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
update variable declaration location
This commit is contained in:
parent
8d8d0377a2
commit
56154216b7
@ -35,11 +35,13 @@ type storeTxnRead struct {
|
||||
}
|
||||
|
||||
func (s *store) Read(mode ReadTxMode, trace *traceutil.Trace) TxnRead {
|
||||
var tx backend.ReadTx
|
||||
s.mu.RLock()
|
||||
s.revMu.RLock()
|
||||
// backend holds b.readTx.RLock() only when creating the concurrentReadTx. After
|
||||
// ConcurrentReadTx is created, it will not block write transaction.
|
||||
// For read-only workloads, we use shared buffer by copying transaction read buffer
|
||||
// for higher concurrency with ongoing blocking writes.
|
||||
// For write/write-read transactions, we use the shared buffer
|
||||
// rather than duplicating transaction read buffer to avoid transaction overhead.
|
||||
var tx backend.ReadTx
|
||||
if mode == ConcurrentReadTxMode {
|
||||
tx = s.b.ConcurrentReadTx()
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user