Skip to content

Make pedantic checks less fatal, fix an upgrade related null field access#3191

Merged
niftynei merged 4 commits intoElementsProject:masterfrom
cdecker:fix-postgres-for-real
Oct 21, 2019
Merged

Make pedantic checks less fatal, fix an upgrade related null field access#3191
niftynei merged 4 commits intoElementsProject:masterfrom
cdecker:fix-postgres-for-real

Conversation

@cdecker
Copy link
Member

@cdecker cdecker commented Oct 20, 2019

Reverts the assert into a warning that we can watch for in the tests and logs, so we can fix them as they come up and then re-arm the asserts once we're happy that we have caught all of them. On postgres we'll still catch them given the field length check,

We also fix an upgrade related null field (which was the real cause for #3189), where we'd have a null field if a payment was forwarded inbetween commits 66a47d2 (which started tracking forwardings) and d901304 (which added the received_time column). Since this is a rare thing, and we can't really just remove a compat check later, I opted to just set these cases to 0.

Fixes #3189

@cdecker cdecker added this to the 0.7.3 milestone Oct 20, 2019
@cdecker cdecker requested a review from niftynei October 20, 2019 21:37
@cdecker cdecker self-assigned this Oct 20, 2019
@jb55
Copy link
Collaborator

jb55 commented Oct 21, 2019

thanks, this fixed it

Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Ack 11de3ce

Checking on whether we access a null field is ok, but should we crash right
away? Probably not. This reduces the access to a warning on sqlite3 and let's
it continue. We can look for occurences and fix them as they come up and then
re-arm the asserts once we addressed all cases.
The case where this is needed is when the wallet had a forwarded payment
somewhere between commits 66a47d2 (which started tracking forwardings) and
d901304 (which added the `received_time` column). This just emulates the
behavior of sqlite3 for postgres as well.

Signed-off-by: Christian Decker <@cdecker>
@cdecker cdecker force-pushed the fix-postgres-for-real branch from 11de3ce to e86c5ba Compare October 21, 2019 07:12
@niftynei
Copy link
Collaborator

ACK 037aad2

@niftynei niftynei merged commit 21c8eaf into ElementsProject:master Oct 21, 2019
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.

consistent crash in listforwards

4 participants