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

chore: Postgres enhance get oldest timestamp #2687

Merged
merged 5 commits into from
May 10, 2024

Conversation

Ivansete-status
Copy link
Collaborator

@Ivansete-status Ivansete-status commented May 9, 2024

Description

This PR enhances the case where, for any reason, there are old empty partitions. In that case of empty partitions, they are not considered when getting the oldest timestamp. Instead, the oldest timestamp was only considered from the oldest row.

Therefore, when "time" retention policy is applied, we should also consider those old-empty partitions so that they can get erased properly.

Issue

closes #2689

Copy link

github-actions bot commented May 9, 2024

This PR may contain changes to database schema of one of the drivers.

If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues.

Please make sure the label release-notes is added to make sure upgrade instructions properly highlight this change.

Copy link

github-actions bot commented May 9, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2687-rln-v1

Built from 73b4758

Copy link

github-actions bot commented May 9, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2687-rln-v2

Built from 73b4758

@Ivansete-status Ivansete-status force-pushed the postgres-enhance-get-oldest-timestamp branch from ba19625 to ea24341 Compare May 9, 2024 09:33
@Ivansete-status Ivansete-status marked this pull request as ready for review May 9, 2024 16:29
Copy link
Contributor

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@@ -701,7 +701,10 @@ proc getInt(
try:
retInt = parseInt(str)
except ValueError:
return err("exception in getInt, parseInt: " & getCurrentExceptionMsg())
return err(
fmt"exception in getInt, parseInt, str:[{str}] query:[{query}]: " &
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI fmt can raise and prevent using raises: [] on procs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI fmt can raise and prevent using raises: [] on procs.

Thanks for the comment! I fixed that even though I cannot link to the actual commit (I had to force-push as I rebased from origin.)

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

Thank you!

@Ivansete-status Ivansete-status force-pushed the postgres-enhance-get-oldest-timestamp branch from ea24341 to 784f856 Compare May 10, 2024 12:20
@Ivansete-status Ivansete-status merged commit 8451cf8 into master May 10, 2024
14 of 15 checks passed
@Ivansete-status Ivansete-status deleted the postgres-enhance-get-oldest-timestamp branch May 10, 2024 16:31
Ivansete-status added a commit that referenced this pull request May 14, 2024
* postgres: consider also the existing paritions when getting oldest timestamp
* test_driver_postgres_query: adapt test to oldest timestamp
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.

chore: enhance time retention policy in Postgres
4 participants