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

refactor: Use heartbeat date ranges to track progress #26094

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

tomasfarias
Copy link
Contributor

@tomasfarias tomasfarias commented Nov 8, 2024

Problem

Tracking progress in a world with multiple simultaneous flushes to destinations is impossible to do with just a single cursor (last_inserted_at). As flushes could finish out of order, increasing the cursor could be silently dropping data from flushes that would have finish later but are contain earlier data, if a worker were to crash at the right (or wrong) time.

Changes

This PR changes our implementation of hearbeating a single cursor value to heartbeating ranges, date ranges.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

Added a bunch of tests.

@tomasfarias tomasfarias removed the stale label Nov 18, 2024
@tomasfarias tomasfarias force-pushed the feat/range-heartbeats-for-batch-exports branch 3 times, most recently from d8d5013 to e0c7575 Compare November 18, 2024 11:20
@tomasfarias tomasfarias force-pushed the feat/range-heartbeats-for-batch-exports branch from e3aec8e to 59e0a7f Compare November 21, 2024 10:52
@tomasfarias tomasfarias force-pushed the feat/range-heartbeats-for-batch-exports branch from 975ff4f to ce6ecdf Compare November 21, 2024 15:27
@tomasfarias tomasfarias force-pushed the feat/range-heartbeats-for-batch-exports branch from 20189af to a866795 Compare November 22, 2024 13:18
@tomasfarias tomasfarias marked this pull request as ready for review November 22, 2024 14:56
@PostHog PostHog deleted a comment from posthog-bot Nov 22, 2024
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