Skip to content
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

osiris_log:overview/1 - fix crash with trailing empty index. #168

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

kjnilsson
Copy link
Contributor

@kjnilsson kjnilsson commented Aug 20, 2024

Also delete any segment files that do not have any index files that may have been caused by a process crash during retention deletion.

See: rabbitmq/rabbitmq-server#12054

Refactoring around file listings.

Also a fix to segment counter after recovery with an empty log.

@kjnilsson kjnilsson force-pushed the osiris-log-overview-fixes-and-more branch from ae1053d to a11fd00 Compare August 20, 2024 10:59
Also delete any segment files that do not have any index files that
may have been caused by a process crash during retention deletion.

Refactoring around file listings.
@kjnilsson kjnilsson force-pushed the osiris-log-overview-fixes-and-more branch from a11fd00 to 320f5c9 Compare August 20, 2024 11:00
@kjnilsson kjnilsson marked this pull request as draft August 20, 2024 11:47
@kjnilsson kjnilsson marked this pull request as ready for review August 20, 2024 11:55
src/osiris_log.erl Outdated Show resolved Hide resolved
@kjnilsson kjnilsson force-pushed the osiris-log-overview-fixes-and-more branch from 81f087b to da891c4 Compare August 20, 2024 14:42
@michaelklishin michaelklishin added this to the 1.8.3 milestone Aug 21, 2024
@michaelklishin michaelklishin merged commit a55f011 into main Aug 21, 2024
7 checks passed
@michaelklishin michaelklishin deleted the osiris-log-overview-fixes-and-more branch August 21, 2024 03:02
is_file(File) ->
case prim_file:read_file_info(File) of
{ok, #file_info{type = directory}} ->
true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false? Copy-paste from is_dir()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. I cannot immediately think of a reason to treat directories as "files" here.

Note that this function is only used in one test in osiris_log_SUITE and it is used with a "regular" file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function can be removed. Apart from being wrong it was copied from Ra and never really used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants