etcd: STM to allow prefetching of keys and full ranges
This commit adds more full range caching to the STM such that we'll be able to prefetch keys and ranges on the kvdb level. This will allow us to reduce roundtrips to etcd do fast iteration of small ranges.
This commit is contained in:
4 files changed
+495
-151
No files matched your search
+4
-2
@@ -219,7 +219,8 @@ func (db *db) View(f func(tx walletdb.ReadTx) error, reset func()) error {
|
||||
return f(newReadWriteTx(stm, etcdDefaultRootBucketId, nil))
|
||||
}
|
||||
|
||||
return RunSTM(db.cli, apply, db.txQueue, db.getSTMOptions()...)
|
||||
_, err := RunSTM(db.cli, apply, db.txQueue, db.getSTMOptions()...)
|
||||
return err
|
||||
}
|
||||
|
||||
// Update opens a database read/write transaction and executes the function f
|
||||
@@ -240,7 +241,8 @@ func (db *db) Update(f func(tx walletdb.ReadWriteTx) error, reset func()) error
|
||||
return f(newReadWriteTx(stm, etcdDefaultRootBucketId, nil))
|
||||
}
|
||||
|
||||
return RunSTM(db.cli, apply, db.txQueue, db.getSTMOptions()...)
|
||||
_, err := RunSTM(db.cli, apply, db.txQueue, db.getSTMOptions()...)
|
||||
return err
|
||||
}
|
||||
|
||||
// PrintStats returns all collected stats pretty printed into a string.
|
||||
|
||||
Reference in new issue
Block a user