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:
@@ -35,11 +35,13 @@ type storeTxnRead struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *store) Read(mode ReadTxMode, trace *traceutil.Trace) TxnRead {
|
func (s *store) Read(mode ReadTxMode, trace *traceutil.Trace) TxnRead {
|
||||||
var tx backend.ReadTx
|
|
||||||
s.mu.RLock()
|
s.mu.RLock()
|
||||||
s.revMu.RLock()
|
s.revMu.RLock()
|
||||||
// backend holds b.readTx.RLock() only when creating the concurrentReadTx. After
|
// For read-only workloads, we use shared buffer by copying transaction read buffer
|
||||||
// ConcurrentReadTx is created, it will not block write transaction.
|
// 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 {
|
if mode == ConcurrentReadTxMode {
|
||||||
tx = s.b.ConcurrentReadTx()
|
tx = s.b.ConcurrentReadTx()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user