Skip to content

Commit

Permalink
chore: bump the timeout to validate deletes have executed (#24204)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech authored Aug 5, 2024
1 parent 2670a6a commit bd1be16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion posthog/models/async_deletion/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class AsyncDeletionProcess(ABC):
CLICKHOUSE_MUTATION_CHUNK_SIZE = 1_000_000
CLICKHOUSE_VERIFY_CHUNK_SIZE = 1_000
CLICKHOUSE_VERIFY_CHUNK_SIZE = 300
DELETION_TYPES: list[DeletionType] = []

def __init__(self) -> None:
Expand Down
4 changes: 3 additions & 1 deletion posthog/models/async_deletion/delete_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# We purposely set this lower than the 256KB limit in ClickHouse to account for the potential overhead of the argument
# substitution and settings injection. This is a conservative estimate, but it's better to be safe than hit the limit.
MAX_QUERY_SIZE = 230_000 # 230KB which is less than 256KB limit in ClickHouse
MAX_SELECT_EXECUTION_TIME = 1 * 60 * 60 # 1 hour(s)


# Note: Session recording, dead letter queue, logs deletion will be handled by TTL
TABLES_TO_DELETE_TEAM_DATA_FROM = [
Expand Down Expand Up @@ -127,7 +129,7 @@ def _verify_by_column(self, distinct_columns: str, async_deletions: list[AsyncDe
WHERE {" OR ".join(conditions)}
""",
args,
settings={"max_execution_time": 30 * 60},
settings={"max_execution_time": MAX_SELECT_EXECUTION_TIME},
)
return {tuple(row) for row in clickhouse_result}

Expand Down

0 comments on commit bd1be16

Please sign in to comment.