From 7af836b2309a8004d858aa54a72d7ea23f351e43 Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Thu, 1 Aug 2024 05:00:31 +0530 Subject: [PATCH 1/2] fix: Increase timeout for block stream health check (#957) Increasing timeout for the block stream health check to ensure unwanted stalled flagging of properly executing block streams. When QueryApi is restarted, a thundering herd situation can lead to slower queries. --- block-streamer/src/block_stream.rs | 2 +- coordinator/src/handlers/block_streams.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/block-streamer/src/block_stream.rs b/block-streamer/src/block_stream.rs index a9af3f10..c9a25ac6 100644 --- a/block-streamer/src/block_stream.rs +++ b/block-streamer/src/block_stream.rs @@ -131,7 +131,7 @@ impl BlockStream { redis.get_last_processed_block(&config).await.unwrap(); loop { - tokio::time::sleep(std::time::Duration::from_secs(15)).await; + tokio::time::sleep(std::time::Duration::from_secs(120)).await; let new_last_processed_block = if let Ok(block) = redis.get_last_processed_block(&config).await { diff --git a/coordinator/src/handlers/block_streams.rs b/coordinator/src/handlers/block_streams.rs index 01bb88a8..b3e9fb5c 100644 --- a/coordinator/src/handlers/block_streams.rs +++ b/coordinator/src/handlers/block_streams.rs @@ -248,7 +248,7 @@ impl BlockStreamsHandler { let updated_at = SystemTime::UNIX_EPOCH + Duration::from_secs(health.updated_at_timestamp_secs); - let stale = updated_at.elapsed().unwrap_or_default() > Duration::from_secs(60); + let stale = updated_at.elapsed().unwrap_or_default() > Duration::from_secs(180); let stalled = matches!( health.processing_state.try_into(), Ok(ProcessingState::Stalled) @@ -257,7 +257,11 @@ impl BlockStreamsHandler { if !stale && !stalled { return Ok(()); } else { - tracing::info!(stale, stalled, "Restarting stalled block stream"); + tracing::info!( + stale, + stalled, + "Restarting stalled block stream after {RESTART_TIMEOUT_SECONDS} seconds" + ); } } else { tracing::info!( From 701ea19f800ce700a365ac4e3ab44ac04668a986 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <42101107+Kevin101Zhang@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:42:53 -0400 Subject: [PATCH 2/2] fix: removed overwritting of indexername in obj (#962) Databricks stores account and function names in their sanitized form (Only alphanumerics and underscores) as this is how they are stored in Hasura. However, the actual indexer and accounts are stored in both RPC and the queryapi_indexer under their original names. This PR prevents the metadata from databricks overwriting the original names with the sanitized ones. --- frontend/widgets/src/QueryApi.IndexerExplorer.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/widgets/src/QueryApi.IndexerExplorer.jsx b/frontend/widgets/src/QueryApi.IndexerExplorer.jsx index 02f99c3c..8456be1c 100644 --- a/frontend/widgets/src/QueryApi.IndexerExplorer.jsx +++ b/frontend/widgets/src/QueryApi.IndexerExplorer.jsx @@ -74,9 +74,9 @@ const fetchIndexerData = () => { const sanitizedAccountID = author_account_id.replace(/\./g, '_'); const key = `${sanitizedAccountID}/${indexer_name}`; return ({ + ...(indexerMetaData.has(key) && indexerMetaData.get(key)), accountId: author_account_id, indexerName: indexer_name, - ...(indexerMetaData.has(key) && indexerMetaData.get(key)) }) }); // sort by numQueries @@ -158,8 +158,6 @@ const fetchIndexerMetadata = () => { original_deployment_date }) => { const indexer = { - accountId: indexer_account_id, - indexerName: indexer_name, lastDeploymentDate: last_deployment_date, numDeployements: num_deployements, numQueries: num_queries,