Skip to content

Commit dc6a957

Browse files
chore: Be more verbose about init of db (#391)
* chore: Provide more insight into the DB init * bump version in stage
1 parent de6b4ab commit dc6a957

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

deploy/stage/common-values-iris-mpc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: "ghcr.io/worldcoin/iris-mpc:v0.6.5"
1+
image: "ghcr.io/worldcoin/iris-mpc:v0.6.6"
22

33
environment: stage
44
replicaCount: 1

iris-mpc-store/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,17 @@ DO UPDATE SET right_code = EXCLUDED.right_code, right_mask = EXCLUDED.right_mask
330330
let mut rng = StdRng::seed_from_u64(rng_seed);
331331

332332
if clear_db_before_init {
333+
tracing::info!("Cleaning up the db before initializing irises");
333334
// Cleaning up the db before inserting newly generated irises
334335
self.rollback(0).await?;
335336
}
336337

337338
let mut tx = self.tx().await?;
338339

340+
tracing::info!(
341+
"DB size before initialization: {}",
342+
self.count_irises().await?
343+
);
339344
for i in 0..db_size {
340345
if (i % 1000) == 0 {
341346
tracing::info!("Initializing iris db: Generated {} entries", i);

iris-mpc/src/bin/server.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,19 @@ async fn server_main(config: Config) -> eyre::Result<()> {
540540

541541
let store_len = store.count_irises().await?;
542542

543+
tracing::info!(format!(
544+
"Size of the database during startup: {}",
545+
store_len
546+
));
547+
543548
// Seed the persistent storage with random shares if configured and db is still
544549
// empty.
545550
if store_len == 0 && config.init_db_size > 0 {
546-
tracing::info!("Initialize persistent iris db with randomly generated shares");
551+
tracing::info!(format!(
552+
"Initialize persistent iris DB with {} randomly generated shares",
553+
config.init_db_size
554+
));
555+
tracing::info!(format!("Resetting the db: {}", config.clear_db_before_init));
547556
store
548557
.init_db_with_random_shares(
549558
RNG_SEED_INIT_DB,

0 commit comments

Comments
 (0)