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

fix: extended Postgres code to support retention policy + refactoring #2244

Merged
merged 5 commits into from
Nov 24, 2023

Conversation

ABresting
Copy link
Contributor

@ABresting ABresting commented Nov 23, 2023

Description

The bug was caused due to Postgres not supporting the SQLite like functionality on the retention policy. Changes introduce Postgres to calculate the database size. Also, some refactoring for a cleaner code interface.

The calculation form GB/MB to bytes is done wrong on purpose since it touches the client-facing interface thus requires a wider conversation and will be corrected in a different PR under the #2247

Changes

  • Postgres supporting retention policy updates.
  • Waku store node running with Postgres using size-based retention policy.
  • Database unit of processing has been set to bytes from Mebibytes

Issue

closes #2242

Copy link

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.

@ABresting ABresting changed the title bug: extended Postgres code to support retention policy + refactoring fix: extended Postgres code to support retention policy + refactoring Nov 23, 2023
Copy link

github-actions bot commented Nov 23, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2244

Built from a9391f4

@ABresting ABresting added the release-notes Issue/PR needs to be evaluated for inclusion in release notes highlights or upgrade instructions label Nov 23, 2023
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

We using Mib or MB ?

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! I added a few nitpick comments though :)
Thanks ! 💯

waku/waku_archive/driver.nim Outdated Show resolved Hide resolved
Co-authored-by: Simon-Pierre Vivier <simvivier@status.im>
@ABresting
Copy link
Contributor Author

LGTM! Thanks

We using Mib or MB ?

Since it is on the node level, then we use MiB i.e. denominator is 1024 not 1000

@SionoiS
Copy link
Contributor

SionoiS commented Nov 24, 2023

Since it is on the node level, then we use MiB i.e. denominator is 1024 not 1000

I think I saw a MB somewhere.

waku/common/databases/db_sqlite.nim Outdated Show resolved Hide resolved
@ABresting ABresting merged commit a1ed517 into master Nov 24, 2023
3 checks passed
@ABresting ABresting deleted the bug-postgres-mount-archive-protocol branch November 24, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes Issue/PR needs to be evaluated for inclusion in release notes highlights or upgrade instructions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: failed to mount waku archive protocol when using postgres
3 participants