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

ADBDEV-5496: Use Postgres allocator for ZSTD (GPDB 7) #1138

Open
wants to merge 2 commits into
base: adb-7.2.0
Choose a base branch
from

Conversation

bandetto
Copy link
Member

This is a cherry-pick of 7185bf8.

Changes were adapted to GPDB 7. Autoconf check was adjusted to behave the same way as the existing code. Both PRs from the original task were integrated into this commit.

This PR should be rebased to preserve authorship.

@bandetto bandetto force-pushed the ADBDEV-5496 branch 2 times, most recently from 1def093 to 7d51b44 Compare November 29, 2024 10:21
@RekGRpth
Copy link
Member

RekGRpth commented Dec 3, 2024

maybe change this

Use custom allocators for zstd (#566)

to

Use custom allocators for zstd (#1138)

to avoid confusion?

Comment on lines 1311 to 1312
ZSTD_customMem zstdCustomMem;
zstdCustomMem.customAlloc = zstdCustomAlloc;
Copy link
Member

Choose a reason for hiding this comment

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

In the original commit here and below, the new variable declaration was closer to the other declarations.

bandetto pushed a commit that referenced this pull request Dec 11, 2024
gpdb uses zstd to compress workfiles, but it can't control memory
allocation
within zstd. Meanwhile, zstd allocates as much memory as it needs which
results
in ambiguous error message in a case of memory exhaustion and can make
OOM
killer stop gpdb processes with force. This patch forces zstd to use our
custom
allocator which can keep track of allocated memory. Since this zstd
feature is
experimental and its api can change, we also had to link zstd
statically.

(cherry picked from commit 7185bf8)

---

Changes were adapted to GPDB 7. Autoconf check was adjusted to behave
the same
way as the existing code. Both PRs from the original task were
integrated into
this commit.
gpdb uses zstd to compress workfiles, but it can't control memory
allocation
within zstd. Meanwhile, zstd allocates as much memory as it needs which
results
in ambiguous error message in a case of memory exhaustion and can make
OOM
killer stop gpdb processes with force. This patch forces zstd to use our
custom
allocator which can keep track of allocated memory. Since this zstd
feature is
experimental and its api can change, we also had to link zstd
statically.

(cherry picked from commit 7185bf8)

---

Changes were adapted to GPDB 7. Autoconf check was adjusted to behave
the same
way as the existing code. Both PRs from the original task were
integrated into
this commit.
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.

2 participants