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-5478: Truncate segment files of AO relations before unlink (#675) #1133

Open
wants to merge 1 commit into
base: adb-7.2.0
Choose a base branch
from

Conversation

silent-observer
Copy link

@silent-observer silent-observer commented Nov 26, 2024

Truncate segment files of AO relations before unlink (#675)

Problem description:
Segment files of the AO tables were not truncated before unlink. As a result,
after relation drop, if there were file descriptors of segment files, not closed
by some backend process, disk space was not returned to the OS.

Root cause:
In mdunlinkfork, mdunlink_ao is called for an AO relation instead of truncating
all segment files. And mdunlink_ao doesn't perform truncation of segment files.

Fix:
Truncation of segment files for AO tables was added into mdunlink_ao_perFile,
which is called from mdunlink_ao for each segment file. For that purpose, static
function do_truncate was changed to global. Plus aomd unit test was updated.
Reason - unit test calls mdunlink_ao with filenames of not-existing files. Unit
test replaces unlink, so it can handle such filenames. But now
mdunlink_ao_perFile returns before invoking unlink, because do_truncate fails to
do truncation of these files. To fix it, do_truncate in aomd unit test was
replaced with a stub during the test.

Changes from original commit:

  1. Added RESET for default_tablespace to previous test.

(cherry picked from commit 6f0a2c1)


Note: do not squash to preserve authorship

@whitehawk
Copy link

In the commit description:

  1. Added RESET for `default_tablespace`` to previous test.

there is an excessive quote.

@whitehawk
Copy link

whitehawk commented Nov 27, 2024

Please add a not to the PR description that rebase is required (just not to forget)

Problem description:
Segment files of the AO tables were not truncated before unlink. As a result,
after relation drop, if there were file descriptors of segment files, not closed
by some backend process, disk space was not returned to the OS.

Root cause:
In mdunlinkfork, mdunlink_ao is called for an AO relation instead of truncating
all segment files. And mdunlink_ao doesn't perform truncation of segment files.

Fix:
Truncation of segment files for AO tables was added into mdunlink_ao_perFile,
which is called from mdunlink_ao for each segment file. For that purpose, static
function do_truncate was changed to global. Plus aomd unit test was updated.
Reason - unit test calls mdunlink_ao with filenames of not-existing files. Unit
test replaces unlink, so it can handle such filenames. But now
mdunlink_ao_perFile returns before invoking unlink, because do_truncate fails to
do truncation of these files. To fix it, do_truncate in aomd unit test was
replaced with a stub during the test.

Changes from original commit:
1. Added RESET for `default_tablespace` to previous test.

(cherry picked from commit 6f0a2c1)
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