Skip to content

[WIP] Feat: Payload Store Repository #2047

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

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

mrkaye97
Copy link
Contributor

@mrkaye97 mrkaye97 commented Jul 23, 2025

Description

WIP

Footguns / things to consider:

  • What happens if something needs to be updated?
  • I think I broke the triggers field in the payloads somehow
  • Should the OLAP repo and the non-OLAP repo read from the same store / db? (probably makes sense, since "database" isn't a thing with S3)

Type of change

  • New feature (non-breaking change which adds functionality)

Copy link

vercel bot commented Jul 23, 2025

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

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 10:14pm
hatchet-v0-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 10:14pm

Comment on lines 7 to 8
task_id BIGINT NOT NULL,
task_inserted_at TIMESTAMPTZ NOT NULL,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unsure if this is a good idea or not - I was trying to think of cases where we'd want to tie payloads to non-task things but was struggling to think of any

workflows: newWorkflowRepository(shared),
ticker: newTickerRepository(shared),
filters: newFilterRepository(shared),
payloadStore: shared.payloadStore,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was pretty unhappy with this. The reason for it is we need to be able to access the payload store inside of the match repo, the tasks repo, the olap repo, etc., but we also need it on the dispatcher. Would love better ideas here, since I think this also will break the ability to override but I'm not sure about that

}

func (p *payloadStoreRepositoryImpl) Store(ctx context.Context, tenantId string, payloads []StorePayloadOpts) error {
tx, commit, rollback, err := sqlchelpers.PrepareTx(ctx, p.pool, p.l, 5000)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

basic idea here is we can change this to have any backend (e.g. S3 with a cache, etc.) so that we can plug whatever we need in. For S3, we might use e.g. taskId/taskInsertedAt/type.json as the key or something like that

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.

1 participant