-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add support for S3 failover #4553
Conversation
Codecov ReportBase: 92.71% // Head: 92.51% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4553 +/- ##
============================================
- Coverage 92.71% 92.51% -0.21%
- Complexity 2895 2926 +31
============================================
Files 532 535 +3
Lines 17172 17188 +16
Branches 1805 1810 +5
============================================
- Hits 15921 15901 -20
- Misses 904 940 +36
Partials 347 347
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
...orter/src/main/java/com/hedera/mirror/importer/downloader/provider/S3StreamFileProvider.java
Show resolved
Hide resolved
Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
8ade773
to
21779a8
Compare
Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
} | ||
}) | ||
.filter(s -> s != null && s.getFileType() == SIGNATURE) | ||
.collect(groupingBy(StreamFilename::getInstant, maxBy(StreamFilename.EXTENSION_COMPARATOR))); |
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 removed the grouping by instant functionality. This would only occur when the account balance csv and pg.gz file were uploaded simultaneously for a short period of time.
It's fine to download either one as they're both equally valid so we can simplify our logic to just rely on the single layer of grouping by StreamFilename
(which uses filename without compression suffix as distinct key) via the multimap. That way we don't pay the cost of nested grouping all files for a temporary window.
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.
Looks good to me.
Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
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.
looks good!
...or-importer/src/main/java/com/hedera/mirror/importer/addressbook/AddressBookServiceImpl.java
Outdated
Show resolved
Hide resolved
...ror-importer/src/main/java/com/hedera/mirror/importer/downloader/ConsensusValidatorImpl.java
Show resolved
Hide resolved
...irror-importer/src/main/java/com/hedera/mirror/importer/downloader/DownloaderProperties.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
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.
LGTM
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
Looks good
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.
lgtm
* Add a ConsensusNode abstraction and use it everywhere instead of node account IDs or calling the address book multiple times per file * Add a connection timeout property and increase it to 5s to avoid occasional connection errors. * Add hedera.mirror.importer.downloader.sources properties that grandfathers legacy hedera.mirror.importer.downloader properties as the primary source in list * Change stream file persistence to write files to a node ID based path * Increase downloader batch size to 100 to improve historical sync speed * Refactor Downloader to push S3 logic into StreamFileProvider abstraction * Replace hedera.mirror.importer.downloader.*.batchSize with generic hedera.mirror.importer.downloader.batchSize * Replace hedera.mirror.importer.downloader.*.threads with generic hedera.mirror.importer.downloader.threads * Remove hedera.mirror.importer.downloader.*.prefix in favor of existing StreamType properties Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com> Signed-off-by: mgoelswirlds <mugdha.goel@swirldslabs.com>
Description:
ConsensusNode
abstraction and use it everywhere instead of node account IDs or calling the address book multiple times per filehedera.mirror.importer.downloader.sources
properties that grandfathers legacyhedera.mirror.importer.downloader
properties as the primary source in listDownloader
to push S3 logic intoStreamFileProvider
abstractionhedera.mirror.importer.downloader.*.batchSize
with generichedera.mirror.importer.downloader.batchSize
hedera.mirror.importer.downloader.*.threads
with generichedera.mirror.importer.downloader.threads
hedera.mirror.importer.downloader.*.prefix
in favor of existingStreamType
propertiesRelated issue(s):
Fixes #54
Fixes #4538
Notes for reviewer:
Checklist