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: archive - move error to trace level when insert row fails #2283

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

Ivansete-status
Copy link
Collaborator

Description

That is helpful to prevent the node to spam the logs when it shares connection to the same Postgres database with other nodes, in which case the following log appears too much:

topics="waku archive" tid=1 file=archive.nim:113 err="error in runStmt: error in dbConnQueryPrepared calling waitQueryToFinish: error in query: ERROR: duplicate key value violates unique constraint "messageindex" DETAIL: Key
(messagehash)=(88f4ee115eef6f233a7dceaf975f03946e18666adda877e38d61be98add934e8) already exists. "

That is helpful to prevent the node to spam the logs when it shares
connection to the same Postgres database with other nodes, in
which case the following log appears too much:

topics="waku archive" tid=1 file=archive.nim:113 err="error in
runStmt: error in dbConnQueryPrepared calling waitQueryToFinish: error
in query: ERROR: duplicate key value violates unique constraint
"messageindex" DETAIL: Key
(messagehash)=(88f4ee115eef6f233a7dceaf975f03946e18666adda877e38d61be98add934e8)
already exists. "
Copy link

github-actions bot commented Dec 12, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2283

Built from d738f17

@Ivansete-status Ivansete-status marked this pull request as ready for review December 12, 2023 09:52
@Ivansete-status Ivansete-status self-assigned this Dec 12, 2023
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.

The code change is ok as is, but my first think are we sure we are just hiding such dupl instert issues only? Cannot we distinguish somehow between such failures?

This condition happens when multiple nodes share the same database
@Ivansete-status
Copy link
Collaborator Author

The code change is ok as is, but my first think are we sure we are just hiding such dupl instert issues only? Cannot we distinguish somehow between such failures?

I've applied this. Now only change the log level for "duplicate insert" errors and leave the rest of errors in debug level.

@Ivansete-status Ivansete-status merged commit 574cdf5 into master Dec 15, 2023
9 of 10 checks passed
@Ivansete-status Ivansete-status deleted the reduce-insert-log-level branch December 15, 2023 17:58
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.

4 participants