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

db: Fix the ordering of channel_htlcs in postgres #5863

Merged
merged 1 commit into from
Jan 2, 2023

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Dec 30, 2022

I discovered this while reworking the CI workflow, and it seems like the HTLC queries do not order, while the tests assume a specific order. This matches sqlite3 which without an explicit ORDER clause will use insertion order, while postgres does not keep things in insertion order, thus breaking the assumption. Ordering by id re-establishes that implicit assumption

Changelog-Changed: postgres: Ordering of HTLCs in listhtlcs are now ordered by time of creation

I discovered this while reworking the CI workflow, and it seems like
the HTLC queries do not order, while the tests assume a specific
order. This matches sqlite3 which without an explicit ORDER clause
will use insertion order, while postgres does not keep things in
insertion order, thus breaking the assumption. Ordering by `id`
re-establishes that implicit assumption

Changelog-Changed: postgres: Ordering of HTLCs in `listhtlcs` are now ordered by time of creation
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

ACK 93d9acf

Oh this is a good catch, look like this depends on how postgress store the informations under the hood, interesting

@cdecker cdecker merged commit 845503f into ElementsProject:master Jan 2, 2023
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.

2 participants