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-5540] [v24.1.x] Pandaproxy: Avoid large allocations whilst serializing JSON #21450

Merged
merged 15 commits into from
Jul 17, 2024

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented Jul 16, 2024

Backport of PR #20827

Fixes #21297

BenPope added 15 commits July 16, 2024 22:26
Some structures serialize quite large, so in order to avoid
oversize allocs, it's necessary to use a buffer type that is not
based onn contiguous memmory.

Explicitly instantiate all overloads with StringBuffer.

Fix the test due to the way name lookup works.

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 7cea48d)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit ebc4c13)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 9fcb311)
Namespace changed due to lookup rules for templates.

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit a455d23)

Conflicts:
  src/v/pandaproxy/json/requests/produce.h (utils/tristate))
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 5d90218)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit d74ec2a)

Conflicts:
  src/v/pandaproxy/schema_registry/handlers.cc (no JSON in this branch)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit f17567f)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 744b0f0)

Conflicts:
  src/v/pandaproxy/json/requests/produce.h (utils/tristate)
This reverts commit 313d208.

Some edits required to avoid temporaries..

(cherry picked from commit 5f3236c)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit c676f6e)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 240c682)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 8560e0a)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 6795578)
Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit c934757)
It shouldn't be used in the general case.

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit ac7c7dd)
@BenPope BenPope added area/schema-registry Schema Registry service within Redpanda kind/backport PRs targeting a stable branch labels Jul 16, 2024
@BenPope BenPope added this to the v24.1.10 milestone Jul 16, 2024
@BenPope BenPope self-assigned this Jul 16, 2024
@BenPope BenPope requested a review from michael-redpanda July 16, 2024 21:59
Copy link
Member

@oleiman oleiman left a comment

Choose a reason for hiding this comment

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

lgtm. if I'm reading right, 5ecdb7c was the only really hairy one?

@BenPope
Copy link
Member Author

BenPope commented Jul 16, 2024

lgtm. if I'm reading right, 5ecdb7c was the only really hairy one?

Nah, git did it, I didn't have to touch it for the backport, it was clean.

@oleiman
Copy link
Member

oleiman commented Jul 16, 2024

lgtm. if I'm reading right, 5ecdb7c was the only really hairy one?

Nah, git did it, I didn't have to touch it for the backport, it was clean.

Some edits required to avoid temporaries..

not manual edits? ignore me!

@BenPope
Copy link
Member Author

BenPope commented Jul 17, 2024

Blocked on the merge for #21323

@BenPope BenPope merged commit a022cde into redpanda-data:v24.1.x Jul 17, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda area/schema-registry Schema Registry service within Redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants