etcd: redesign commit queue to make it more robust and scalable

This commit builds on the ideas of @cfromknecht in lnd/5153. The
addition is that the design is now simpler and more robust by queueing
up everything, but allowing maximal parallelism where txns don't block.
Furthermore the commit makes CommitQueue.Done() private essentially
removing the need to understand the queue externally.
This commit is contained in:
Andras Banki-Horvath committed 2021-08-06 07:53:13 +02:00
1 parent 02aa77261d
commit b29ae94e10
5 files changed
+136 -62

No files matched your search

+5 -5
View File
@@ -28,7 +28,7 @@ func TestPutToEmpty(t *testing.T) {
defer func() {
cancel()
f.Cleanup()
txQueue.Wait()
txQueue.Stop()
}()
db, err := newEtcdBackend(ctx, f.BackendConfig())
@@ -55,7 +55,7 @@ func TestGetPutDel(t *testing.T) {
defer func() {
cancel()
f.Cleanup()
txQueue.Wait()
txQueue.Stop()
}()
testKeyValues := []KV{
@@ -141,7 +141,7 @@ func TestFirstLastNextPrev(t *testing.T) {
defer func() {
cancel()
f.Cleanup()
txQueue.Wait()
txQueue.Stop()
}()
testKeyValues := []KV{
@@ -299,7 +299,7 @@ func TestCommitError(t *testing.T) {
defer func() {
cancel()
f.Cleanup()
txQueue.Wait()
txQueue.Stop()
}()
db, err := newEtcdBackend(ctx, f.BackendConfig())
@@ -347,7 +347,7 @@ func TestManualTxError(t *testing.T) {
defer func() {
cancel()
f.Cleanup()
txQueue.Wait()
txQueue.Stop()
}()
db, err := newEtcdBackend(ctx, f.BackendConfig())