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: Do not merge heartbeat ranges #26653

Closed
wants to merge 2 commits into from

Conversation

tomasfarias
Copy link
Contributor

Problem

Merging heartbeat ranges in batch exports has currently two problems:

  • If there are multiple ranges to merge, the function will fail as we pop indexes in a loop thus modifying the index we should pop in future loop iterations.
  • We do not have enough information to marge two date ranges: There could be events with the same inserted_at still missing.

Until we update the queue to keep track of a record batch index that we can use to merge ranges together, let's just not merge.

Changes

👉 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?

@tomasfarias tomasfarias requested a review from rossgray December 4, 2024 18:59
Comment on lines +56 to +71
NON_RETRYABLE_ERROR_TYPES = [
# Raised on errors that are related to database operation.
# For example: unexpected disconnect, database or other object not found.
"OperationalError",
# The schema name provided is invalid (usually because it doesn't exist).
"InvalidSchemaName",
# Missing permissions to, e.g., insert into table.
"InsufficientPrivilege",
# A column, usually properties, exceeds the limit for a VARCHAR field,
# usually the max of 65535 bytes
"StringDataRightTruncation",
# Raised by our PostgreSQL client when failing to connect after several attempts.
"PostgreSQLConnectionError",
# Column missing in Redshift, likely the schema was altered.
"UndefinedColumn",
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Err, didn't intend to get this out yet, working on SPMC for redshift. But anyways, won't hurt to merge now.

Copy link
Contributor

@rossgray rossgray left a comment

Choose a reason for hiding this comment

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

not quite sure I understand all the complexities here but agree it makes sense to keep it simple for now

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.

@posthog-bot
Copy link
Contributor

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants