-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix update recency issue with expanded test coverage #63
Fix update recency issue with expanded test coverage #63
Conversation
d02d1bc
to
54a0d67
Compare
@@ -143,7 +143,7 @@ pub(crate) fn db_index_creation_query() -> &'static str { | |||
CREATE INDEX IF NOT EXISTS channel_updates_scid_dir_seen_desc_with_id ON channel_updates(short_channel_id ASC, direction ASC, seen DESC) INCLUDE (id); | |||
CREATE UNIQUE INDEX IF NOT EXISTS channel_updates_key ON channel_updates (short_channel_id, direction, timestamp); | |||
CREATE INDEX IF NOT EXISTS channel_updates_seen ON channel_updates(seen); | |||
CREATE INDEX IF NOT EXISTS channel_updates_timestamp_desc ON channel_updates(timestamp DESC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check that this is now unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only tested the specific query that I now changed, but prepending short_channel_id ASC does make it no longer use that index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, my question was if any other queries use that index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other three channel_update queries don't seem to be using it with my local test database, but my postgres seems to occasionally select indices distinct from yours, so you may wanna double-check your instance, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mine doesn't seem to either.
248b8b1
to
0aff71f
Compare
@@ -111,7 +111,7 @@ impl<L: Deref> GossipPersister<L> where L::Target: Logger { | |||
} | |||
|
|||
match &gossip_message { | |||
GossipMessage::ChannelAnnouncement(announcement) => { | |||
GossipMessage::ChannelAnnouncement(announcement, _) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add the override field if we can't use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't added the unit test for an old announcement yet that was gonna use it. I can do that now to make sure this does end up finding some use immediately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's alright, I just feel weird adding it freestanding but if you already have code queued up to use it we'll survive.
This should have fixed #61, but please let us know if you continue to see issues. |
No description provided.