feat: database initialization logging (#2228)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/24376/head
Raphael Taylor-Davies 2021-08-09 13:13:33 +01:00 committed by GitHub
parent 559db4529d
commit 54a8fff328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -316,6 +316,8 @@ async fn initialize_database(shared: &DatabaseShared) {
}
};
info!(%db_name, %state, "attempting to advance database initialization state");
// Try to advance to the next state
let next_state = match state {
DatabaseState::Known(state) => match state.advance(shared).await {
@ -336,6 +338,8 @@ async fn initialize_database(shared: &DatabaseShared) {
// Commit the next state
{
let mut state = shared.state.write();
info!(%db_name, from=%state, to=%next_state, "database initialization state transition");
*state.unfreeze(handle) = next_state;
shared.state_notify.notify_waiters();
}