Skip to content

feat: Support uploading attachments directly to objectstore#5367

Merged
Swatinem merged 4 commits intomasterfrom
swatinem/store-async
Nov 18, 2025
Merged

feat: Support uploading attachments directly to objectstore#5367
Swatinem merged 4 commits intomasterfrom
swatinem/store-async

Conversation

@Swatinem
Copy link
Copy Markdown
Contributor

@Swatinem Swatinem commented Nov 11, 2025

Changes to the UploadService to handle whole envelopes, uploading attachments and mutating the envelope items in-place, before forwarding it to the StoreService for further forwarding to kafka.

@Swatinem Swatinem self-assigned this Nov 11, 2025
@Swatinem Swatinem requested a review from a team as a code owner November 11, 2025 12:13
@Swatinem Swatinem force-pushed the swatinem/store-async branch 3 times, most recently from cd9d7f2 to 72eff76 Compare November 13, 2025 10:02
assert!(rx.recv().await.is_none());
}
}
// #[cfg(test)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Being able to test the impl would be nice, maybe the objectstore client can provide some funcationality there to simplify testing, otherwise we might need to either go generic or dyn for tests.

@jjbayer @Swatinem thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We either rely 100% on integration tests, or mock the objectstore somehow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the objectstore client is not the reason I commented this out, but rather that setting up all of the store endpoint, etc was too much of a pain.
Its a bit unfortunate that forwarding to Store is now a sideeffect that I can not easily test. Maybe its worth changing things in such a way that I can just test with envelopes directly, without going through all that channel nonesense.

Basically just testing the actual logic, and not all the overhead wrapped around it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is Addr::custom() to set up a dummy receiver that you can inspect.

Copy link
Copy Markdown
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

I like the direct flow of the envelope from the upload service to the store service. Apart from some minor comments I think we can merge this, but the question remains how we are going to reconcile the event attachments use case with the span attachment use case.

assert!(rx.recv().await.is_none());
}
}
// #[cfg(test)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We either rely 100% on integration tests, or mock the objectstore somehow.

@Swatinem Swatinem force-pushed the swatinem/store-async branch from 6955a30 to 0de7084 Compare November 17, 2025 08:24
@Swatinem Swatinem force-pushed the swatinem/store-async branch from 6a7c235 to c2790f7 Compare November 17, 2025 14:26
Copy link
Copy Markdown
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Looks like the PR description is outdated.

This makes part of the `StoreService` async, and has to pass through the `ManagedEnvelope` into `store_envelope`, as we have to derive a `Managed` instance of the attachment from that.

Other than that, this does not look too bad, except that going through a channel is just a pain.
@Swatinem Swatinem force-pushed the swatinem/store-async branch from c2790f7 to e7c8e3b Compare November 18, 2025 10:03
@Swatinem Swatinem added this pull request to the merge queue Nov 18, 2025
Merged via the queue into master with commit fd4a796 Nov 18, 2025
27 of 28 checks passed
@Swatinem Swatinem deleted the swatinem/store-async branch November 18, 2025 10:58
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.

3 participants