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

feat: temporary tablespaces #3464

Merged
merged 4 commits into from
Dec 7, 2023
Merged

feat: temporary tablespaces #3464

merged 4 commits into from
Dec 7, 2023

Conversation

leonardoce
Copy link
Contributor

@leonardoce leonardoce commented Dec 5, 2023

This commit introduces the .spec.tablespaces[*].name.temporary option to
determine whether a tablespace should be added to the temp_tablespaces
PostgreSQL parameter, and thus become eligible to store temporary data that
does not have an explicit tablespace assignment.

Closes: #11

Copy link
Contributor

github-actions bot commented Dec 5, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

github-actions bot commented Dec 5, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@leonardoce
Copy link
Contributor Author

Base automatically changed from feature-tablespaces to main December 6, 2023 09:57
Copy link
Contributor

github-actions bot commented Dec 6, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@leonardoce leonardoce marked this pull request as ready for review December 6, 2023 10:15
Copy link
Contributor

github-actions bot commented Dec 6, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@leonardoce
Copy link
Contributor Author

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@leonardoce
Copy link
Contributor Author

leonardoce commented Dec 6, 2023

I added a basic E2e tests for temporary tablespaces: https://github.com/EnterpriseDB/cloudnative-pg/actions/runs/7116382754

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@leonardoce
Copy link
Contributor Author

Comment on lines +546 to +550
// Apply the list of temporary tablespaces
if len(info.TemporaryTablespaces) > 0 {
configuration.OverwriteConfig("temp_tablespaces", strings.Join(info.TemporaryTablespaces, ","))
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

just a question here, from yesterday's discussion with Marco.
Should we add the empty string here, so the default temp tablespace is included?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. Let's involve @mnencia here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion, when you create a temporary tablespace, you're doing that because you want to use it as long as possible. This is why I'd leave out the empty string from this set, at least by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO in the initial implementation we should not. The recommended approach is to add one or more tablespaces to dedicate for temporary purposes, freeing PGDATA from that use case. In the future we might want to introduce an option for PGDATA, but I'd leave it out for now.

Copy link
Contributor

github-actions bot commented Dec 7, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

github-actions bot commented Dec 7, 2023

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@jsilvela jsilvela added no-issue do not backport This PR must not be backported - it will be in the next minor release labels Dec 7, 2023
leonardoce and others added 4 commits December 7, 2023 16:18
This patch allows the user to set a tablespace as temporary, by changing
the value of the `temp_tablespaces` PostgreSQL setting.

Closes: #11

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
@gbartolini gbartolini merged commit 28b8133 into main Dec 7, 2023
25 of 27 checks passed
@gbartolini gbartolini deleted the dev/temp-tablespaces branch December 7, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not backport This PR must not be backported - it will be in the next minor release no-issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tablespaces, including temporary
3 participants