@@ -9,8 +9,11 @@ import (
9
9
10
10
/*
11
11
The KVStores are stored in the following structure in the KV db. Note that
12
- the `perm` and `temp` buckets are identical in structure. The only difference is
13
- that the `temp` bucket is cleared on restart of the db.
12
+ the `perm` and `temp` buckets are identical in structure. The only difference
13
+ is that the `temp` bucket is cleared on restart of the db. The reason persisting
14
+ the temporary store changes instead of just keeping an in-memory store is that
15
+ we can then guarantee idempotency if changes are made to both the permanent and
16
+ temporary stores.
14
17
15
18
rules -> perm -> rule-name -> global -> {k:v}
16
19
-> sessions -> group ID -> session-kv-store -> {k:v}
@@ -81,11 +84,17 @@ type KVStoreTx interface {
81
84
Local () KVStore
82
85
83
86
// GlobalTemp is similar to the Global store except that its contents
84
- // is cleared upon restart of the database.
87
+ // is cleared upon restart of the database. The reason persisting the
88
+ // temporary store changes instead of just keeping an in-memory store is
89
+ // that we can then guarantee idempotency if changes are made to both
90
+ // the permanent and temporary stores.
85
91
GlobalTemp () KVStore
86
92
87
93
// LocalTemp is similar to the Local store except that its contents is
88
- // cleared upon restart of the database.
94
+ // cleared upon restart of the database. The reason persisting the
95
+ // temporary store changes instead of just keeping an in-memory store is
96
+ // that we can then guarantee idempotency if changes are made to both
97
+ // the permanent and temporary stores.
89
98
LocalTemp () KVStore
90
99
}
91
100
0 commit comments