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

CORE-1614 storage: Initialize timestamps in the compaction_placeholder #17716

Merged

Conversation

Lazin
Copy link
Contributor

@Lazin Lazin commented Apr 9, 2024

The compaction_placeholder batch wasn't initialized properly and because of that the invalid timestamps equal to -1 leaked into the TS layer. The rp-storage-tool crashed while trying to parse the list of timestamps.

Fixes #15312

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

compaction_placeholder batch. The batch wasn't initialized properly and
because of that the invalid timestamps leaked into the TS layer.
Copy link
Contributor

@andrwng andrwng left a comment

Choose a reason for hiding this comment

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

Nice find

@@ -135,6 +135,8 @@ model::record_batch copy_data_segment_reducer::make_placeholder_batch(
new_hdr.type = model::record_batch_type::compaction_placeholder;
new_hdr.base_offset = hdr.base_offset;
new_hdr.last_offset_delta = hdr.last_offset_delta;
new_hdr.first_timestamp = hdr.first_timestamp;
Copy link
Contributor

Choose a reason for hiding this comment

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

storage: Initialize timestamps in the ...

nit: I guess the contributing guide mentions line length, but is this style really preferred over a line over 50 characters? I've been assuming 50 was just a suggestion to generally keep the titles short, but this seems harder to grok over git history than a slightly longer line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the title of the PR is different from the title of the commit (which has proper size)

Copy link
Member

Choose a reason for hiding this comment

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

Initialize timestamps in the ...

The subject of a commit message, in this case storage: Initialize timestamps in the ... is the thing that shows up when you do a git shortlog. It's not really intended to be the first part of the commit message body, it's generally useful to have that be understandable without the context of the body of the commit message. In this case that isn't true.

Copy link
Contributor

@bharathv bharathv left a comment

Choose a reason for hiding this comment

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

nice find.

@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Apr 9, 2024

@dotnwat dotnwat changed the title storage: Initialize timestamps in the compaction_placeholder CORE-1614 storage: Initialize timestamps in the compaction_placeholder Apr 9, 2024
@Lazin
Copy link
Contributor Author

Lazin commented Apr 10, 2024

CI failures are caused by Maven build.

@piyushredpanda piyushredpanda merged commit 404efaf into redpanda-data:dev Apr 10, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants