-
Notifications
You must be signed in to change notification settings - Fork 40
Fix failure log writing issue in storage mode for Data Loader imports #3189
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
Conversation
Summary of ChangesHello @inv-jishnu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the data loader's import mechanism where failure logs were not being generated correctly, particularly when operating in storage mode and with raw record logging enabled. The changes refactor the logging logic to ensure that all failure records are consistently logged, regardless of the raw record flag, and centralize the conditional inclusion of raw records in the import results. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request effectively addresses the issue of failure logs not being written. The changes in SingleFileImportLogger and SplitByDataChunkImportLogger correctly decouple failure logging from the raw record logging flag. The refactoring in ImportTask to introduce getRecordForLogging and centralize the logic for including raw records is a great improvement for code clarity and maintainability. I have one suggestion to further improve the maintainability of ImportTask.java by reducing some code duplication.
ypeckstadt
left a comment
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. Thank you.
|
@inv-jishnu This fix can be ported to 3.16.2 patch release right? |
|
@inv-jishnu Could you please fix the Gradle check failure in CI? |
data-loader/core/src/main/java/com/scalar/db/dataloader/core/dataimport/task/ImportTask.java
Show resolved
Hide resolved
@brfrn169 san, |
.../core/src/main/java/com/scalar/db/dataloader/core/dataimport/log/SingleFileImportLogger.java
Show resolved
Hide resolved
brfrn169
left a comment
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! Thank you!
komamitsu
left a comment
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! 👍
thongdk8
left a comment
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! Thank you!
feeblefakie
left a comment
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! Thank you!
Torch3333
left a comment
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, thank you!
…#3189) Co-authored-by: Toshihiro Suzuki <[email protected]>
…#3189) Co-authored-by: Toshihiro Suzuki <[email protected]>
Description
In this PR, I fixed an issue where failure logs were not written in storage mode due to an incorrect flag check. The logic has been updated so that the
log raw recordcheck happens at the point where the record is added to the import result object, instead of right before writing the log. The problem only appeared in storage mode because the previous check was located inside the log-writing method used exclusively for that mode.Related issues and/or PRs
NA
Changes made
I have tested the changes in my local environment with storage and transaction mode with single log and split log modes.
Checklist
Additional notes (optional)
NA
Release notes
Fixed failure log writing issue in storage mode for Data Loader imports