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

Truncate segment files of AO relations before unlink #675

Merged
merged 21 commits into from
Feb 14, 2024

Conversation

whitehawk
Copy link

@whitehawk whitehawk commented Jan 18, 2024

Truncate segment files of AO relations before unlink

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.

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

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

Fix:
Add truncation of segment files for AO tables into mdunlink_ao_perFile, called
from mdunlink_ao for each segment file.
For that purpose static function do_truncate was renamed and moved to
accessible api in fd.h.
@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/62020

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/976188

@BenderArenadata
Copy link

Failed job Behave tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/976186

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/976189

src/include/storage/fd.h Outdated Show resolved Hide resolved
Updated tablespace test to check that AO tables do not leave 'orphaned' files
with not zero size after table drop.
@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/62120

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/980626

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/980627

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/980621

Improved check that AO tables do not leave 'orphaned' files with not zero
size after table drop.
@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/62187

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984211

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984212

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984205

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984339

@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/62221

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984888

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984889

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/984882

@RekGRpth
Copy link
Member

Actualize PR and commit descritions

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/986171

@whitehawk whitehawk marked this pull request as ready for review January 22, 2024 23:12
@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/62290

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/987725

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/987726

@whitehawk
Copy link
Author

Could you please split the patch into two different patches/commits, each for a different issue?

What is the purpose of splitting into 2 different commits?

These are two different problems that can be solved independently of each other.

Ok, discussed it with Andrey Sokolov. As decision - for second problem I will create a separate ticket, and process it after first PR is complete.

ADBDEV-4953 was created

@whitehawk whitehawk changed the title Truncate AO and temporary relation files before unlink Truncate segment files of AO relations before unlink Feb 8, 2024
@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/63638

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1048888

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1048889

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1048882

@bimboterminator1
Copy link
Member

@whitehawk , add the header to the patch description accroding to the paragraph 2.2 of style guidelines.

@RekGRpth
Copy link
Member

RekGRpth commented Feb 9, 2024

add the header to the patch description accroding to the paragraph 2.2 of style guidelines.

also, PR description may be reformatted up to 80 chars

@whitehawk
Copy link
Author

add the header to the patch description accroding to the paragraph 2.2 of style guidelines.

also, PR description may be reformatted up to 80 chars

done

@whitehawk
Copy link
Author

@whitehawk , add the header to the patch description accroding to the paragraph 2.2 of style guidelines.

done

RekGRpth
RekGRpth previously approved these changes Feb 9, 2024
@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/64437

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1067025

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1067026

@BenderArenadata
Copy link

Allure report https://allure-ee.adsw.io/launch/64445

@BenderArenadata
Copy link

Failed job Resource group isolation tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1067307

@BenderArenadata
Copy link

Failed job Resource group isolation tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1067309

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1067302

@andr-sokolov andr-sokolov merged commit 6f0a2c1 into adb-6.x-dev Feb 14, 2024
5 checks passed
@andr-sokolov andr-sokolov deleted the ADBDEV-4565 branch February 14, 2024 14:31
@Stolb27 Stolb27 mentioned this pull request Mar 13, 2024
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.

None yet

5 participants