-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass instant from aptosdb for calculating latency metric #15678
base: main
Are you sure you want to change the base?
Conversation
⏱️ 2h 10m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
ecosystem/indexer-grpc/indexer-grpc-table-info/src/internal_indexer_db_service.rs
Outdated
Show resolved
Hide resolved
0988f9c
to
5f9b440
Compare
@@ -166,31 +166,32 @@ impl InternalIndexerDBService { | |||
|
|||
pub async fn run(&mut self, node_config: &NodeConfig) -> Result<()> { | |||
let mut start_version = self.get_start_version(node_config).await?; | |||
let mut target_version = self.db_indexer.main_db_reader.ensure_synced_version()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will error out with an empty db (before genesis is put in), is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, internal indexer is supposed to start after main db bootstrapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay..
ecosystem/indexer-grpc/indexer-grpc-table-info/src/internal_indexer_db_service.rs
Outdated
Show resolved
Hide resolved
ecosystem/indexer-grpc/indexer-grpc-table-info/src/internal_indexer_db_service.rs
Outdated
Show resolved
Hide resolved
log_grpc_step( | ||
SERVICE_TYPE, | ||
IndexerGrpcStep::InternalIndexerDBProcessed, | ||
Some(start_version as i64), | ||
Some(next_version as i64), | ||
None, | ||
None, | ||
Some(start_time.elapsed().as_secs_f64()), | ||
Some(step_timer.elapsed().as_secs_f64()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue with yesterday, that before it's caught up you already logged the latency, which is not accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each loop now is blocked on notification of write to main db. Previously, each loop is only a batch of all updates. so this should reflect the latency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
1db3ecd
to
cc5d099
Compare
16ad465
to
072b5ff
Compare
log_grpc_step( | ||
SERVICE_TYPE, | ||
IndexerGrpcStep::InternalIndexerDBProcessed, | ||
Some(start_version as i64), | ||
Some(next_version as i64), | ||
None, | ||
None, | ||
Some(start_time.elapsed().as_secs_f64()), | ||
Some(step_timer.elapsed().as_secs_f64()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
@@ -166,31 +166,32 @@ impl InternalIndexerDBService { | |||
|
|||
pub async fn run(&mut self, node_config: &NodeConfig) -> Result<()> { | |||
let mut start_version = self.get_start_version(node_config).await?; | |||
let mut target_version = self.db_indexer.main_db_reader.ensure_synced_version()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay..
Err(e) => { | ||
panic!("Failed to get update from update_receiver: {}", e); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how this thread knows the main db has quit, right? In that case we should return Ok
instead of suicide here?
And I realized even in the previous logic, this thread doesn't have a chance to quit until hitting the target version? It can be an issue when the first time the indexer is enabled? (granted we usually quit the maindb by killing the whole process, it'd be better if we deal with this case gracefully, if not too complicated.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- the DBindexer should have Arc of main_db. I expect the err should never be caused by main_db quit. (The main db quits after db indexer being dropped). Thus, I think it should panic if this unexpected error occurs.
- if the process is killed while the indexer is in the middle of processing a large amount of data. the thread is terminated the same way as other components reading main_db eg: API is reading transactions using storage interface and the node is killed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, in that case the indexer loop never quits? That should be an issue in tests?
Shall we implement graceful quitting (separately)? @grao1991 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't disagree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a method called "run_with_end_version" for testing
@grao1991 please take a look as well ? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4f6258c
to
17b78fb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
❌ Forge suite
|
❌ Forge suite
|
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist