ADBDEV-5478: Truncate segment files of AO relations before unlink (#675) #1133
+63
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
default_tablespace
to previous test.(cherry picked from commit 6f0a2c1)
Note: do not squash to preserve authorship