-
Notifications
You must be signed in to change notification settings - Fork 592
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
cloud_storage: Extend fast trim cleanup to new segment name #13158
cloud_storage: Extend fast trim cleanup to new segment name #13158
Conversation
c58a5da
to
20417b1
Compare
src/v/cloud_storage/cache_service.cc
Outdated
const std::regex segment_expr{ | ||
R"#(.*\.log(\.\d+)?)#", std::regex_constants::optimize}; |
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.
Could we avoid constructing this regex on every invocation to trim_fast
(e.g. make it a member)?
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 think we should also use re2, since it's already linked
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.
Moved to anonymous namespace
src/v/cloud_storage/cache_service.cc
Outdated
const std::regex segment_expr{ | ||
R"#(.*\.log(\.\d+)?)#", std::regex_constants::optimize}; |
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: a comment on segment formats would be nice
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.
Added a comment, but I suspect there is a better way to document these expressions and strings which are spread around, perhaps the path name strings and associated patterns should live in a central specification namespace.
When a log segment is removed in fast trim, the associated index and tx files are also removed. This commit extends this feature to new log segment name formats, which may contain a term after the name.
20417b1
to
56089f5
Compare
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.
Shouldn't we backport to v23.2?
I don't think this is a big enough change to backport, but if you think this is important or can cause a problem I can backport. |
23.2 has a long life ahead of it, so I think we should backport fixes whenever possible. |
/backport v23.2.x |
Started the backport |
When a log segment is removed in fast trim, the associated index and tx files are also removed. This commit extends this feature to new log segment name formats, which may contain a term after the name.
Backports Required
Release Notes