Skip to content

Commit a415fdc

Browse files
sshaderConvex, Inc.
authored andcommitted
Add some more logging to backfill_exact_snapshot_of_table (#24361)
* GitOrigin-RevId: bb7bf4bc0faaa6d062be31255075dac64fb6da21
1 parent ce0d262 commit a415fdc

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

crates/database/src/index_worker.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ impl<RT: Runtime> IndexWriter<RT> {
657657
.fuse();
658658
pin_mut!(stream);
659659
let mut index_updates_written = 0;
660+
let mut last_logged = self.runtime.system_time();
660661
while !stream.is_done() {
661662
let mut chunk = BTreeSet::new();
662663
while chunk.len() < *INDEX_BACKFILL_CHUNK_SIZE {
@@ -678,8 +679,18 @@ impl<RT: Runtime> IndexWriter<RT> {
678679
.write(vec![], chunk, ConflictStrategy::Overwrite)
679680
.await?;
680681
}
682+
if last_logged.elapsed()? >= Duration::from_secs(60) {
683+
tracing::info!(
684+
"backfilled {index_updates_written} index rows for table {table_id} at \
685+
snapshot {snapshot_ts}",
686+
);
687+
last_logged = self.runtime.system_time();
688+
}
681689
}
682-
tracing::info!("backfilled {index_updates_written} index rows at snapshot {snapshot_ts}");
690+
tracing::info!(
691+
"backfilled {index_updates_written} index rows for table {table_id} at snapshot \
692+
{snapshot_ts}"
693+
);
683694
Ok(())
684695
}
685696

@@ -892,7 +903,7 @@ impl<RT: Runtime> IndexWriter<RT> {
892903
self.persistence
893904
.write(vec![], chunk, ConflictStrategy::Overwrite)
894905
.await?;
895-
if last_logged.elapsed()? >= Duration::from_secs(10) {
906+
if last_logged.elapsed()? >= Duration::from_secs(60) {
896907
log::info!(
897908
"Backfilled {} index entries of index {}",
898909
num_entries_written,

0 commit comments

Comments
 (0)