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

WGPS progress tracking #35

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

WGPS progress tracking #35

wants to merge 3 commits into from

Conversation

xash
Copy link
Contributor

@xash xash commented Nov 21, 2024

Tracks range counters on both sides. WGPS emits a StatusEvent with simple { todo: number, all: number } info. This is now also used in some tests where reconciliation is expected, to lower the delay. { todo: 0 } could still have some unprocessed entries in some store promise, so still little delay is needed for now.

@xash
Copy link
Contributor Author

xash commented Nov 21, 2024

Ah, that also fixes #26 I think.

Copy link
Contributor

@sgwilym sgwilym left a comment

Choose a reason for hiding this comment

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

Fantastic, only a few nitpicks!

constructor(todo: number, all: number) {
super("status", {
detail: {
todo,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: could we change this to remaining, as at least for me todo triggers thoughts of 'oh, I guess this is something someone forgot to do'?

private count = 0n;
private inProgress = new Set<bigint>();

constructor() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be snipped

@@ -3180,3 +3477,18 @@ export class StoreMap<
return newStore;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you so much for making these tests better.

Fixes also a bug where a received ReconciliationAnnounceEntries
message with wantResponse = true did not increase your_range_counter.
Currently the status will indicate done even when some entries are
yet to be processed, e.g. storing them. That's why there is still a
small(er) delay.
@xash
Copy link
Contributor Author

xash commented Nov 22, 2024

Done :-)

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