-
Notifications
You must be signed in to change notification settings - Fork 81
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
Refactor indexer version config #332
Open
keyliaran
wants to merge
6
commits into
aptos-labs:main
Choose a base branch
from
keyliaran:indexer_version_cfg_refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7de84f4
Add override_starting_version cfg option
keyliaran c7931c5
typo fix
keyliaran 9fedd3e
override_starting_version defaults to true
keyliaran f3d2e7f
fix autoindent
keyliaran 41e489b
Add starting_version_if_nothing_in_db instead of override_starting_ve…
keyliaran 831fa71
Force using of start version if exists
keyliaran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ pub struct Worker { | |
pub grpc_http2_config: IndexerGrpcHttp2Config, | ||
pub auth_token: String, | ||
pub starting_version: Option<u64>, | ||
pub override_starting_version: Option<bool>, | ||
pub ending_version: Option<u64>, | ||
pub number_concurrent_processing_tasks: usize, | ||
pub gap_detection_batch_size: u64, | ||
|
@@ -73,6 +74,7 @@ impl Worker { | |
grpc_http2_config: IndexerGrpcHttp2Config, | ||
auth_token: String, | ||
starting_version: Option<u64>, | ||
override_starting_version: Option<bool>, | ||
ending_version: Option<u64>, | ||
number_concurrent_processing_tasks: Option<usize>, | ||
db_pool_size: Option<u32>, | ||
|
@@ -107,6 +109,7 @@ impl Worker { | |
indexer_grpc_data_service_address, | ||
grpc_http2_config, | ||
starting_version, | ||
override_starting_version, | ||
ending_version, | ||
auth_token, | ||
number_concurrent_processing_tasks, | ||
|
@@ -154,14 +157,21 @@ impl Worker { | |
0 | ||
}); | ||
|
||
let starting_version = self.starting_version.unwrap_or(starting_version_from_db); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for making the change! This line is still necessary to override with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! Fixed |
||
let mut starting_version = self.starting_version.unwrap_or(starting_version_from_db); | ||
|
||
if let Some(override_starting_version) = self.override_starting_version { | ||
if override_starting_version && self.starting_version.is_some() { | ||
starting_version = self.starting_version.unwrap(); | ||
} | ||
} | ||
|
||
info!( | ||
processor_name = processor_name, | ||
service_type = PROCESSOR_SERVICE_TYPE, | ||
stream_address = self.indexer_grpc_data_service_address.to_string(), | ||
final_start_version = starting_version, | ||
start_version_from_config = self.starting_version, | ||
override_starting_version = self.override_starting_version, | ||
start_version_from_db = starting_version_from_db, | ||
"[Parser] Building processor", | ||
); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: update the document
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.
Done
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.
sorry for being late on this.
a question about this: if
starting_version
is specific, does it also mean that processing start from this version regardless of db 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.
I've added a new field called "override_starting_version." The logic is straightforward: