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(zero-cache): handle subscribers ahead of the change-streamer change-log #3655

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

darkgnotic
Copy link
Contributor

Because the change-streamer forwards messages to view-syncers immediately, and concurrently stores and acks upstream, it is possible for a replica to be ahead of the change log if a server is killed before the change can be stored.

Handle this case by considering the subscriber "caught up" if it is ahead of the change log. The existing forwarder logic already handles filtering out messages that have already been seen.

https://discord.com/channels/830183651022471199/1288232858795769917/1334328586265563260

https://discord.com/channels/830183651022471199/1332721644527157319

@darkgnotic darkgnotic requested a review from arv January 30, 2025 04:07
Copy link

vercel bot commented Jan 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
replicache-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2025 4:07am
zbugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2025 4:07am

@darkgnotic darkgnotic enabled auto-merge (squash) January 30, 2025 04:07
Copy link

🐰 Bencher Report

Branchdarkgnotic/back-to-the-future
Testbedlocalhost
Click to view all benchmark results
BenchmarkFile SizeBenchmark Result
kilobytes (KB)
(Result Δ%)
Upper Boundary
kilobytes (KB)
(Limit %)
zero-package.tgz📈 view plot
🚷 view threshold
919.04
(-0.01%)
937.47
(98.03%)
zero.js📈 view plot
🚷 view threshold
171.32
(0.00%)
174.75
(98.04%)
zero.js.br📈 view plot
🚷 view threshold
47.70
(0.00%)
48.66
(98.04%)
🐰 View full continuous benchmarking report in Bencher

Copy link

🐰 Bencher Report

Branchdarkgnotic/back-to-the-future
Testbedlocalhost
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
src/client/zero.bench.ts > basics > All 1000 rows x 10 columns (numbers)📈 view plot
🚷 view threshold
71.36
(-1.27%)
69.67
(97.64%)
src/client/zero.bench.ts > with filter > Lower rows 500 x 10 columns (numbers)📈 view plot
🚷 view threshold
94.07
(-0.25%)
90.75
(96.47%)
🐰 View full continuous benchmarking report in Bencher

@darkgnotic darkgnotic merged commit 02c75e4 into main Jan 30, 2025
11 checks passed
@darkgnotic darkgnotic deleted the darkgnotic/back-to-the-future branch January 30, 2025 04:39
Copy link
Contributor

@arv arv left a comment

Choose a reason for hiding this comment

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

LGTM

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