-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
core/rawdb: no need to run truncateFile for readonly mode #28145
Conversation
Signed-off-by: jsvisa <delweng@gmail.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.
I am not sure this is correct behaviour. Perhaps we should still do the check(s), but instead of repairing errors we should return error?
Yeah, personally I think Martin's point is valuable. We should make sure the freezer is in valid status and report loudly if it's not. Otherwise, the corrupted freezer might return very weird errors when serving read operation. |
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.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
…8145) Avoid truncating files, if ancients are opened in readonly mode. With this change, we return error instead of trying (and failing) to repair
…8145) Avoid truncating files, if ancients are opened in readonly mode. With this change, we return error instead of trying (and failing) to repair
…8145) Avoid truncating files, if ancients are opened in readonly mode. With this change, we return error instead of trying (and failing) to repair
…8145) Avoid truncating files, if ancients are opened in readonly mode. With this change, we return error instead of trying (and failing) to repair
…hereum#28145)" This reverts commit 8fc3449.
…hereum#28145)" This reverts commit 8fc3449.
…8145) Avoid truncating files, if ancients are opened in readonly mode. With this change, we return error instead of trying (and failing) to repair
If a file was opened in read-only mode, the
file.Truncate
will return the error:truncate xxx: invalid argument
. Let's skip it.