-
Notifications
You must be signed in to change notification settings - Fork 53
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(archive): archive and drivers refactor #2761
Conversation
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 |
|
254a419
to
9f90434
Compare
You can find the image built from this PR at
Built from 3ffa8f5 |
You can find the image built from this PR at
Built from 3ffa8f5 |
I have some more issues to fix before review. |
CI is red but I can't reproduce anything... |
6f17946
to
35a4412
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! This is a very complex task and great work so far!
I'm adding some comments that I hope you find useful.
Let's merge when we revisit all the comments and all CI are green (but the js-waku ones)
@@ -0,0 +1,72 @@ | |||
const ContentScriptVersion_6* = | |||
""" | |||
ALTER TABLE IF EXISTS messages_backup RENAME TO messages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot follow the approach of creating a temporary table because there is normally enough disk space to duplicate the current one. Considering that, we need to perform the database changes directly into the partitioned table, i.e. messages
table. That will likely apply the change to the underlying partitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean all changes have to be done in-place? Can this be done even for a primary key? Seams complicated with partitions too. I've been looking into it but I can't find a way to do this. We can't even know the name of the partitions in advance.
edit: i did find a way but it doesn't solve the problem of disk space overhead when migrating.
version INTEGER NOT NULL, | ||
timestamp BIGINT NOT NULL, | ||
meta VARCHAR, | ||
id VARCHAR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to also remove the id
field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that we keep the old values for now so that we are still compatible with v2. Would that not work?
35a4412
to
937c247
Compare
Latest error in CI
I can't reproduce locally. |
Just for our reference, the following PR is waiting for this #2761 one to be merged: status-im/status-go#5123 Once merged we will need to ping @richard-ramos and then we will test this in ( cc @SionoiS ) |
937c247
to
ba56d60
Compare
You can find the image built from this PR at
Built from 8dc0454 |
ba56d60
to
d3af693
Compare
renaming to pubsub
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
* posgres legacy: stop using the storedAt field * migration script 6: we still need the id column The id column is needed because it contains the message digest which is used in store v2, and we need to keep support to store v2 for a while * legacy archive: set target migration version to 6 * waku_node: try to use wakuLegacyArchive if wakuArchive is nil * node_factory, waku_node: mount legacy and future store simultaneously We want the nwaku node to simultaneously support store-v2 requests and store-v3 requests. Only the legacy archive is in charge of archiving messages, and the archived information is suitable to fulfill both store-v2 and store-v3 needs. * postgres_driver: adding temporary code until store-v2 is removed --------- Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
16b692c
to
423b4d8
Compare
Thank you so much guys for the patience and energy invested in this PR 🙌 |
I've tested that the schema migration works well in a 121GB database ( in wakudev host .) |
This is a feature branch used to coordinate a big refactor of archive and all drivers to clean/optimize specifically for Store v3.
This work is required before we start measuring performance of Store v3.
@gabrielmer & @Ivansete-status already reviewed all the PRs but if you want to double check go ahead.
What's new are non-PR related commits.
Related PRs;
Closes:
messageHash
column when using a store query withinclude_data: false
#2637