Skip to content

Commit 6ef6927

Browse files
authored
Merge pull request #3028 from IntersectMBO/per_instance_lmdb_path
fix(utxo-hd): each testnet instance need unique lmdb path
2 parents 77ab0a5 + 0a1eac7 commit 6ef6927

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

cardano_node_tests/cluster_scripts/conway/start-cluster

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ else
229229
cp "$SCRIPT_DIR"/topology-*.json "$STATE_CLUSTER"
230230
fi
231231

232+
LIVE_TABLES_BASE="${STATE_CLUSTER_NAME}/lmdb"
232233
case "${UTXO_BACKEND:=""}" in
233234
"" | mem | disk)
234235
;;
@@ -389,20 +390,25 @@ CONWAY_GENESIS_HASH="$(cardano_cli_log latest genesis hash --genesis \
389390

390391
for conf in "$SCRIPT_DIR"/config-*.json; do
391392
fname="${conf##*/}"
393+
node_name="${fname##config-}"
394+
node_name="${node_name%.json}"
395+
392396
jq \
393397
--arg byron_hash "$BYRON_GENESIS_HASH" \
394398
--arg shelley_hash "$SHELLEY_GENESIS_HASH" \
395399
--arg alonzo_hash "$ALONZO_GENESIS_HASH" \
396400
--arg conway_hash "$CONWAY_GENESIS_HASH" \
397401
--arg backend "$UTXO_BACKEND" \
402+
--arg live_tables_path "${LIVE_TABLES_BASE}-${node_name}" \
398403
'.ByronGenesisHash = $byron_hash
399404
| .ShelleyGenesisHash = $shelley_hash
400405
| .AlonzoGenesisHash = $alonzo_hash
401406
| .ConwayGenesisHash = $conway_hash
402407
| if $backend == "mem" then
403408
.LedgerDB.Backend = "V2InMemory"
404409
elif $backend == "disk" then
405-
.LedgerDB.Backend = "V1LMDB"
410+
(.LedgerDB.Backend = "V1LMDB"
411+
| .LedgerDB.LiveTablesPath = $live_tables_path)
406412
elif has("LedgerDB") then
407413
.LedgerDB |= del(.Backend)
408414
else

cardano_node_tests/cluster_scripts/conway_fast/start-cluster

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ else
168168
cp "$SCRIPT_DIR"/topology-*.json "$STATE_CLUSTER"
169169
fi
170170

171+
LIVE_TABLES_BASE="${STATE_CLUSTER_NAME}/lmdb"
171172
case "${UTXO_BACKEND:=""}" in
172173
"" | mem | disk)
173174
;;
@@ -337,13 +338,17 @@ CONWAY_GENESIS_HASH="$(cardano_cli_log latest genesis hash --genesis \
337338

338339
for conf in "$SCRIPT_DIR"/config-*.json; do
339340
fname="${conf##*/}"
341+
node_name="${fname##config-}"
342+
node_name="${node_name%.json}"
343+
340344
jq \
341345
--arg byron_hash "$BYRON_GENESIS_HASH" \
342346
--arg shelley_hash "$SHELLEY_GENESIS_HASH" \
343347
--arg alonzo_hash "$ALONZO_GENESIS_HASH" \
344348
--arg conway_hash "$CONWAY_GENESIS_HASH" \
345349
--argjson prot_ver "$PROTOCOL_VERSION" \
346350
--arg backend "$UTXO_BACKEND" \
351+
--arg live_tables_path "${LIVE_TABLES_BASE}-${node_name}" \
347352
'.ByronGenesisHash = $byron_hash
348353
| .ShelleyGenesisHash = $shelley_hash
349354
| .AlonzoGenesisHash = $alonzo_hash
@@ -352,7 +357,8 @@ for conf in "$SCRIPT_DIR"/config-*.json; do
352357
| if $backend == "mem" then
353358
.LedgerDB.Backend = "V2InMemory"
354359
elif $backend == "disk" then
355-
.LedgerDB.Backend = "V1LMDB"
360+
(.LedgerDB.Backend = "V1LMDB"
361+
| .LedgerDB.LiveTablesPath = $live_tables_path)
356362
elif has("LedgerDB") then
357363
.LedgerDB |= del(.Backend)
358364
else

cardano_node_tests/cluster_scripts/mainnet_fast/start-cluster

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ else
168168
cp "$SCRIPT_DIR"/topology-*.json "$STATE_CLUSTER"
169169
fi
170170

171+
LIVE_TABLES_BASE="${STATE_CLUSTER_NAME}/lmdb"
171172
case "${UTXO_BACKEND:=""}" in
172173
"" | mem | disk)
173174
;;
@@ -337,13 +338,17 @@ CONWAY_GENESIS_HASH="$(cardano_cli_log latest genesis hash --genesis \
337338

338339
for conf in "$SCRIPT_DIR"/config-*.json; do
339340
fname="${conf##*/}"
341+
node_name="${fname##config-}"
342+
node_name="${node_name%.json}"
343+
340344
jq \
341345
--arg byron_hash "$BYRON_GENESIS_HASH" \
342346
--arg shelley_hash "$SHELLEY_GENESIS_HASH" \
343347
--arg alonzo_hash "$ALONZO_GENESIS_HASH" \
344348
--arg conway_hash "$CONWAY_GENESIS_HASH" \
345349
--argjson prot_ver "$PROTOCOL_VERSION" \
346350
--arg backend "$UTXO_BACKEND" \
351+
--arg live_tables_path "${LIVE_TABLES_BASE}-${node_name}" \
347352
'.ByronGenesisHash = $byron_hash
348353
| .ShelleyGenesisHash = $shelley_hash
349354
| .AlonzoGenesisHash = $alonzo_hash
@@ -352,7 +357,8 @@ for conf in "$SCRIPT_DIR"/config-*.json; do
352357
| if $backend == "mem" then
353358
.LedgerDB.Backend = "V2InMemory"
354359
elif $backend == "disk" then
355-
.LedgerDB.Backend = "V1LMDB"
360+
(.LedgerDB.Backend = "V1LMDB"
361+
| .LedgerDB.LiveTablesPath = $live_tables_path)
356362
elif has("LedgerDB") then
357363
.LedgerDB |= del(.Backend)
358364
else

0 commit comments

Comments
 (0)