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

fix(chainwatch): use height to determine unsynced blocks and fix deadlock in sector deal table #3275

Merged
merged 8 commits into from
Aug 28, 2020

Conversation

frrist
Copy link
Member

@frrist frrist commented Aug 24, 2020

We were detecting syncing problems with chainwatch which ended up being caused by race condition. This resolves the race condition and improve the sync alogrithm so last synced block is more determistically determined by height rather than by time.

@frrist frrist requested a review from placer14 August 24, 2020 23:38
Copy link
Contributor

@placer14 placer14 left a comment

Choose a reason for hiding this comment

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

Please don't merge. Testing with this causes sync to walk the whole chain over and over. Need to review the behavior before merging.

@magik6k magik6k marked this pull request as draft August 26, 2020 14:08
@frrist frrist force-pushed the fix/chainwatch/sync branch from d1e488e to 3f165cc Compare August 26, 2020 20:12
Copy link
Contributor

@placer14 placer14 left a comment

Choose a reason for hiding this comment

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

One bug, a few logging nits. Probably should also flatten this PR given all the back and forth within.

cmd/lotus-chainwatch/syncer/sync.go Show resolved Hide resolved
cmd/lotus-chainwatch/syncer/sync.go Outdated Show resolved Hide resolved
@@ -214,7 +205,7 @@ func (p *Processor) Start(ctx context.Context) {
if err := p.refreshViews(); err != nil {
log.Errorw("Failed to refresh views", "error", err)
}
log.Infow("Processed Batch", "duration", time.Since(loopStart).String())
log.Infow("PROCESSED BATCH COMPLETE", "duration", time.Since(loopStart).String())
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to yell.

@frrist frrist force-pushed the fix/chainwatch/sync branch from 291e4e4 to 629b5c2 Compare August 27, 2020 18:46
@frrist frrist force-pushed the fix/chainwatch/sync branch from 629b5c2 to f934ebd Compare August 27, 2020 18:48
@frrist frrist marked this pull request as ready for review August 27, 2020 18:48
@frrist frrist requested review from placer14 and magik6k August 27, 2020 18:48
@frrist frrist changed the title fix(chainwatch): use height to determine unsynced blocks fix(chainwatch): use height to determine unsynced blocks and fix deadline in sector deal table Aug 27, 2020
@frrist frrist changed the title fix(chainwatch): use height to determine unsynced blocks and fix deadline in sector deal table fix(chainwatch): use height to determine unsynced blocks and fix deadlock in sector deal table Aug 27, 2020
Copy link
Contributor

@placer14 placer14 left a comment

Choose a reason for hiding this comment

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

Changes look GTM.

placer14 and others added 2 commits August 27, 2020 23:21
This table may get multiple updates depending on how many blocks get
added into a tipset. Each new block affects the tipset state, but the
parent state root will remain the same. This allows the very latest
value to be applied.
…wer-reward-metrics

feat(chainwatch): Add more complete power and reward metrics
@magik6k magik6k merged commit 932ab61 into master Aug 28, 2020
@magik6k magik6k deleted the fix/chainwatch/sync branch August 28, 2020 10:16
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.

3 participants