wtdb+wtclient: segregate session-key-index reservations by blob-type
This commit introduces a change in the key format used to reserve/lookup session-key-indexes. Currently the reservations are stored under the tower id, however this creates issues when multiple clients are using the same database since only one reservation is permitted per tower. We fix this by appending the blob type to the session-key-index locator. This allows multiple clients to reserve keys for the same tower, but still limits each client to one outstanding reservation. The changes are made in a way such that we fall back to the legacy format if the a reservation under the new format is not found, but only if the blob type matches blob.TypeAltruistCommit, which is so far the only actively deployed blob type.
This commit is contained in:
5 files changed
+161
-39
No files matched your search
@@ -298,7 +298,9 @@ retryWithBackoff:
|
||||
// Before proceeding, we will reserve a session key index to use
|
||||
// with this specific tower. If one is already reserved, the
|
||||
// existing index will be returned.
|
||||
keyIndex, err := n.cfg.DB.NextSessionKeyIndex(tower.ID)
|
||||
keyIndex, err := n.cfg.DB.NextSessionKeyIndex(
|
||||
tower.ID, n.cfg.Policy.BlobType,
|
||||
)
|
||||
if err != nil {
|
||||
log.Debugf("Unable to reserve session key index "+
|
||||
"for tower=%x: %v", towerPub, err)
|
||||
|
||||
Reference in new issue
Block a user