waku-org / nwaku

Waku node and protocol.
Other
201 stars 52 forks source link

chore: Improve deceptive Archive message log #3164

Open stubbsta opened 3 weeks ago

stubbsta commented 3 weeks ago

Background

There is no log to clarify that there was an attempt to archive a message, but it failed.

Details

The current logs when a store node archives a single message are:

put PostgresDriver                         tid=1 file=postgres_driver.nim:305 messageHash=24948...
message archived                           topics="waku archive" tid=1 file=archive.nim:138 msg_hash...

It is assumed that the log "message archived" verifies that archiving was successful, but if the message is already in the DB, then no message is archived even though the "message archived" log is still present. The log needs to make it clear whether archiving worked or not.

When running a store node with store sync enabled, it is more clear when there is message duplication, because the "archive message" log is followed by these logs:

inserting message into waku sync storage   topics="waku sync" ...
failed to insert message                   topics="waku sync" tid=1 file ...

Acceptance criteria

Modify the log or add an additional log to identify if there was an error.

stubbsta commented 3 weeks ago

@AlbertoSoutullo

stubbsta commented 2 weeks ago

@SionoiS and @chaitanyaprem this also relates to my question about getting the time that a message is inserted into the DB. Perhaps the "message archived" log could include an "inserted time" or something like that.