-
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
[Sharded DB][1] migrate Event and Transaction Schemas #13240
Conversation
⏱️ 4h 4m total CI duration on this PR
|
13555fa
to
a296a65
Compare
827f6d4
to
2678686
Compare
a7ff4f9
to
7b8c2b9
Compare
@@ -0,0 +1,69 @@ | |||
// Copyright © Aptos Foundation |
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.
would it be better to put this file under storage?
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.
more consistent with the existing structure. when we want to refactor in future, it is easier to find them in one place.
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.
Reading the code, it seems weird to me that the logic was split between this crate and storage/indexer. probably a migration was in mind. That said, I guess adding more functionality in either crate is probably okay.
@jillxuu any comments? (And please review this PR as well?)
storage/indexer/src/db_tailer.rs
Outdated
.expect("Cannot create db tailer iterator"); | ||
let batch = SchemaBatch::new(); | ||
let metadata_batch = SchemaBatch::new(); | ||
db_iter.for_each(|res| { |
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.
nit: consider using rayon here.
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.
don't know how to do this? this db_iter is sequential itself.
5d4ec3b
to
7e12fcb
Compare
ecosystem/indexer-grpc/indexer-grpc-table-info/src/table_info_service.rs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,69 @@ | |||
// Copyright © Aptos Foundation |
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.
Reading the code, it seems weird to me that the logic was split between this crate and storage/indexer. probably a migration was in mind. That said, I guess adding more functionality in either crate is probably okay.
@jillxuu any comments? (And please review this PR as well?)
impl Default for IndexDBTailerConfig { | ||
fn default() -> Self { | ||
Self { | ||
enable: false, |
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.
For rollout we probably should default to enabled?
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.
we don't want to turn on tailer by default. For rollout, I assume we have some indexer nodes in mind that we can update their node config?
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.
Can we have one node flag for each index?
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.
added a separate flag anyway. previously thought we read them in batch and no need to separate.
storage/indexer/src/db_tailer.rs
Outdated
}; | ||
use std::sync::Arc; | ||
|
||
pub struct DBTailer { |
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.
why not just call it InternalIndexer or something along that line?
DBTrailer::db
sounds like what the thing is tailing.
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 think it is just tailing the db . Internalindexer can be reserved for sth combining the table info and this tailer?
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.
renamed to DBindexer
storage/indexer/src/db_tailer.rs
Outdated
}); | ||
batch.put::<TailerMetadataSchema>(&version, &())?; | ||
self.db.write_schemas(batch)?; | ||
Ok(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.
Shall we sleep 10ms, for example, if it didn't see any new txns? (Or did you do it somewhere else?)
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.
and shall we make it a pipeline (building the batch and committing it) from the beginning?
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.
It sleeps at the tailer service run
function if no new data from db iterator. made it pipeline
This comment has been minimized.
This comment has been minimized.
84354c2
to
9a2e48f
Compare
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.
9a2e48f
to
d072cd4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13240 +/- ##
=======================================
Coverage ? 58.9%
=======================================
Files ? 817
Lines ? 195823
Branches ? 0
=======================================
Hits ? 115374
Misses ? 80449
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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.
d072cd4
to
d5dc9a6
Compare
Add test for internal indexer merge two traits address review
d5dc9a6
to
9cf89e8
Compare
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.
✅ Forge suite
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
Description
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
both db tailer and table info runs as expected
^C
Key Areas to Review
Checklist