Fix: Remove dual writes into temp tables for status updates#3829
Open
Fix: Remove dual writes into temp tables for status updates#3829
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
abelanger5
approved these changes
May 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy temp-table writes that duplicated OLAP task/DAG status propagation, shifting the codepath toward the direct in-transaction status update flow already used by the repository.
Changes:
- Removes the task-status trigger insert into
v1_task_status_updates_tmp. - Removes the
CreateTaskEventsOLAPTmpSQL/copyfrom plumbing forv1_task_events_olap_tmp. - Adds a migration to update the deployed trigger definition for existing databases.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
sql/schema/v1-olap.sql |
Removes the task update trigger’s enqueue into the DAG temp table. |
pkg/repository/sqlcv1/olap.sql.go |
Regenerated sqlc output after removing the temp-table copyfrom definition. |
pkg/repository/sqlcv1/olap.sql |
Removes the CreateTaskEventsOLAPTmp copyfrom query. |
pkg/repository/sqlcv1/copyfrom.go |
Removes generated copyfrom iterator/function for temp task events. |
pkg/repository/olap.go |
Stops writing task events into the temp queue in writeTaskEventBatch. |
cmd/hatchet-migrate/migrate/migrations/20260505195258_v1_0_104.sql |
Adds migration to replace the deployed trigger function body. |
| r.id = n.id | ||
| AND r.inserted_at = n.inserted_at | ||
| AND r.kind = 'TASK'; | ||
|
|
| @@ -1727,16 +1726,6 @@ func (r *OLAPRepositoryImpl) writeTaskEventBatch(ctx context.Context, tenantId u | |||
| } | |||
|
|
|||
| eventsToWrite = append(eventsToWrite, event) | |||
| r.id = n.id | ||
| AND r.inserted_at = n.inserted_at | ||
| AND r.kind = 'TASK'; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the dual writes into the temp tables by dropping the insert in a trigger (for dags) and dropping the explicit write of the events into the temp table (for tasks)
Type of change