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

bug: failed to mount waku archive protocol when using postgres #2242

Closed
jakubgs opened this issue Nov 23, 2023 · 5 comments · Fixed by #2244
Closed

bug: failed to mount waku archive protocol when using postgres #2242

jakubgs opened this issue Nov 23, 2023 · 5 comments · Fixed by #2244
Assignees
Labels
bug Something isn't working

Comments

@jakubgs
Copy link
Contributor

jakubgs commented Nov 23, 2023

Problem

Current master as well as v0.22.0 release are stuck in a restart loop when using PostgreSQL database:

ERR 2023-11-23 12:37:19.449+00:00 4/7 Mounting protocols failed
    topics="wakunode main" tid=1 file=wakunode2.nim:89
    error="failed to mount waku archive protocol: error in mountArchive: failed execution of retention policy: failed to get Page size:"

Impact

Can't use current codebase on status.test fleet being switched to PostgreSQL.

To reproduce

Use Nim-Waku node with PostgreSQL.

Expected behavior

It works.

Screenshots/logs

If applicable, add screenshots or logs to help explain your problem.

nwaku version/commit hash

Both v0.22.0 and current master.

Additional context

@jakubgs
Copy link
Contributor Author

jakubgs commented Nov 23, 2023

I just checked and this issue appears in v0.21.0 as well.

@jakubgs
Copy link
Contributor Author

jakubgs commented Nov 23, 2023

The shards.test fleet is running aeb77a3e which is current master but doesn't have this problem:

admin@store-01.do-ams3.shards.test:~ % d
CONTAINER ID   NAMES            IMAGE                              CREATED        STATUS
920badb37699   nim-waku-store   wakuorg/nwaku:deploy-shards-test   20 hours ago   Up 20 hours (healthy)

admin@store-01.do-ams3.shards.test:~ % d inspect wakuorg/nwaku:deploy-shards-test | grep commit
                "commit": "aeb77a3e",

@Ivansete-status
Copy link
Collaborator

Thanks for the detailed info!
We have a bug related to the "size" retention policy that doesn't work if the database doesn't exist.

method execute*(p: SizeRetentionPolicy,
                driver: ArchiveDriver):
                Future[RetentionPolicyResult[void]] {.async.} =
  ## when db size overshoots the database limit, shread 20% of outdated messages 

  # get page size of database
  let pageSizeRes = await driver.getPagesSize()
  let pageSize: int64 = int64(pageSizeRes.valueOr(0) div 1024)

  if pageSize == 0:
    return err("failed to get Page size: " & pageSizeRes.error)

Is something that we need to fix.

In order to allow the node to start, let's change to either the "time" or "capacity" retention policies:
e.g.

capacity:20000000

@jakubgs
Copy link
Contributor Author

jakubgs commented Nov 23, 2023

Good catch, thanks, will try this in a bit.

@jakubgs
Copy link
Contributor Author

jakubgs commented Nov 23, 2023

Indeed, I can confirm setting the retention not based on size does fix the issue at startup:

admin@node-01.do-ams3.status.test:~ % d
CONTAINER ID   NAMES      IMAGE                              CREATED         STATUS
3d6868ff0701   nim-waku   wakuorg/nwaku:deploy-status-test   2 minutes ago   Up 2 minutes (healthy)

jakubgs added a commit to status-im/infra-status-legacy that referenced this issue Nov 23, 2023
It's currently broken:
waku-org/nwaku#2242

Signed-off-by: Jakub Sokołowski <jakub@status.im>
@ABresting ABresting self-assigned this Nov 23, 2023
@ABresting ABresting moved this to Code Review / QA in Waku Nov 23, 2023
@github-project-automation github-project-automation bot moved this from Code Review / QA to Done in Waku Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants