Skip to content

Conversation

@oleiman
Copy link
Member

@oleiman oleiman commented Dec 5, 2024

Missing fmt::format call resulting in ill-formed serialization of decimal iceberg field type.

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
  • v24.3.x
  • v24.2.x
  • v24.1.x

Release Notes

Bug Fixes

  • Fixes a bug where serializing manifests for Iceberg topics with decimal fields could cause Redpanda to crash or upload invalid manifests

Missing fmt::format call resulting in ill-formed serialization of
decimal iceberg field type.
@oleiman oleiman requested a review from andrwng December 5, 2024 22:48
@oleiman oleiman self-assigned this Dec 5, 2024
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.

Thanks for catching and fixing! Probably worth an actual release note

@oleiman
Copy link
Member Author

oleiman commented Dec 5, 2024

Note to reviewers: Test escape as a result of the example schema being non-exhaustive with respect to allowable field types. I'll expand the test schema in a follow up and update any dependent tests as needed.

@oleiman
Copy link
Member Author

oleiman commented Dec 5, 2024

Probably worth an actual release note

Ya, my knowledge of the iceberg schema lexicon is pretty limited. Any suggestions for a more detailed note?

@andrwng
Copy link
Contributor

andrwng commented Dec 5, 2024

Fixes a bug where the decimal field type specifier would be serialized incorrectly

nit: maybe mention Iceberg somehow?

@andrwng
Copy link
Contributor

andrwng commented Dec 5, 2024

How about:

"Fixes a bug where Iceberg topics with decimal fields would serialize manifests incorrectly"

@oleiman
Copy link
Member Author

oleiman commented Dec 5, 2024

How about:

"Fixes a bug where Iceberg topics with decimal fields would serialize manifests incorrectly"

Ah yeah i deleted the word iceberg by accident 🤦

Anyway, looks good

void operator()(const iceberg::double_type&) { w.String("double"); }
void operator()(const iceberg::decimal_type& t) {
w.String("decimal({}, {})", t.precision, t.scale);
w.String(fmt::format("decimal({}, {})", t.precision, t.scale));
Copy link
Member

Choose a reason for hiding this comment

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

weird was this invoking the String(char*, size_t, bool) interface?

Copy link
Member

@dotnwat dotnwat Dec 5, 2024

Choose a reason for hiding this comment

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

if so, then

would serialize manifests incorrectly

is an understatement. this fixes what could just be segfault

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, fair. So maybe:

Fixes a bug where serializing manifests for Iceberg topics with decimal fields could cause Redpanda to crash or upload invalid manifests

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah good point

@oleiman oleiman enabled auto-merge December 6, 2024 00:47
@vbotbuildovich
Copy link
Collaborator

@oleiman oleiman merged commit ca91536 into redpanda-data:dev Dec 6, 2024
19 of 20 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.3.x

@piyushredpanda
Copy link
Contributor

Nice, thanks, @oleiman !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants