Skip to content

discovery/sync_manager: restart historical sync on first connected peer - #3103

Merged
halseth merged 2 commits into
lightningnetwork:masterfrom
halseth:syncmanager-resync-historical
May 24, 2019
Merged

discovery/sync_manager: restart historical sync on first connected peer#3103
halseth merged 2 commits into
lightningnetwork:masterfrom
halseth:syncmanager-resync-historical

Conversation

@halseth

@halseth halseth commented May 21, 2019

Copy link
Copy Markdown
Contributor

To handle the case where we have been without peers, and get a new
connection, we reset the historical scan booleans when the first active
syncer is connected to trigger another historical sync.

This would cause integration tests to be flaky (especially with Neutrino), since we would risk not getting graph updates after having being disconnected.

@halseth halseth added discovery Peer and route discovery / whisper protocol related issues/PRs graph neutrino Lightweight neutrino backend-type test flake itests Issues related to integration tests. labels May 21, 2019
@halseth
halseth requested a review from wpaulino May 21, 2019 13:54
@halseth halseth mentioned this pull request May 21, 2019
8 tasks

@wpaulino wpaulino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An alternative approach would be to modify the historical sync interval in the integration tests, though I think this is still useful given the following scenario: if you've lost all your peers and start receiving new updates at tip, you won't be able to process some of these channels if you've yet to see their channel announcement, so performing a historical sync before doing so would make sense.

LGTM 📦

Comment thread discovery/sync_manager.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: seems like a redundant comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed: 9c9ac36

Comment thread discovery/sync_manager_test.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: would prefer if this commit was squashed with what introduced the behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I prefer splitting a bugfix and the test reproducing the bug in separate commits. Especially when I'm reviewing this makes it easy to cherry-pick the test commit on master to exercise the failing scenario.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure but that wasn't the case here. The non-test changes alone didn't have an impact on the tests 😛

@cfromknecht cfromknecht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM after squash! ✅

@halseth
halseth force-pushed the syncmanager-resync-historical branch from 538b403 to 9c9ac36 Compare May 24, 2019 09:00
halseth added 2 commits May 24, 2019 11:05
To handle the case where we have been without peers, and get a new
connection, we reset the historical scan booleans when the first active
syncer is connected to trigger another historical sync.
…nect

TestSyncManagerHistoricalSyncOnReconnect tests that the sync manager will
re-trigger a historical sync when a new peer connects after a historical
sync has completed, but we have lost all peers.
@halseth
halseth force-pushed the syncmanager-resync-historical branch from 9c9ac36 to 6ba6982 Compare May 24, 2019 09:05
@halseth
halseth merged commit af3b04e into lightningnetwork:master May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discovery Peer and route discovery / whisper protocol related issues/PRs graph itests Issues related to integration tests. neutrino Lightweight neutrino backend-type test flake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants