You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
task(dataset): Redirect multipart upload through File Service #4110
The current dataset upload flow exposes MinIO/LakeFS presigned URLs to the client and lets the browser upload file parts directly to object storage. A new design moves the File Service into the data path and introduces server-side upload sessions states keyed by filePath, uid and did.
New DB schema (multipart upload session + parts)
Field / Property
dataset_upload_session
dataset_upload_session_part
Purpose
Tracks one active multipart upload session for a dataset file (per user + dataset + file path).
Tracks per-part completion state for a multipart upload (stores etag needed for finalize).
changed the title [-]task(dataset): Redirect multipart upload though File Service[/-][+]task(dataset): Redirect multipart upload through File Service[/+]on Dec 6, 2025
I came across this issue from the 1.1.0-incubating RC4 release mailing list. Before sharing some thoughts, I want to confirm my understanding of the change:
The multipart upload flow is being changed from client-direct-to-MinIO (via presigned URLs) to fully server-proxied through File Service
A new DB schema is introduced to track upload session state and abort uploads when the cumulative size exceeds the limit
The stated motivations are:
Enforce file size limits that cannot be bypassed by modifying frontend code
Avoid calling listParts()
Abort oversized uploads mid-stream
A few questions and concerns, in case they weren't already addressed in earlier discussions:
1. The threat model
Users who can upload files are authenticated. In an organization-internal deployment, most users can reasonably be assumed trusted, making this attack vector relatively low-motivation. For publicly open deployments, please see the discussion below.
2. Alternative mitigations for the size bypass
The size limit bypass described in #4058 is a valid concern. However, it seems the same goal could be achieved without proxying bytes through the server:
Requiring clients to declare totalSizeBytes at init time and validating it server-side
Configuring a MinIO lifecycle policy to automatically abort incomplete multipart uploads after a timeout
After the multipart upload is completed, check the actual size and delete the object if it exceeds the limit
With this approach, even if a user bypasses the init-time check, the file would still be deleted after upload completes. The remaining risk is temporary resource exhaustion, which can be handled through user quotas and rate limiting on starting upload.
It's also worth noting that bypassing the presigned URL flow requires writing custom client code, this is deliberate malicious behavior from an authenticated user, which may warrant a different risk assessment. Additionally, while content-length-range cannot restrict individual multipart parts, S3 bucket policies support the s3:content-length condition key, which may offer another enforcement point. It may also be possible to cap the total upload size simply by limiting the number of presigned URLs issued. For example, at 50 MB per part, issuing at most 200 URLs would effectively cap uploads at 10 GB. Whether MinIO supports these policy conditions would need verification, but seems worth exploring.
3. On avoiding listParts()
It's not clear why avoiding listParts() is listed as a benefit. listParts() or getting file stats is a straightforward way to verify per-part state and the true file size. The overhead of either call is negligible compared to the cost of routing all upload traffic through File Service.
4. Server performance under the new design
Proxying byte streams through File Service will consume server CPU, memory, and network bandwidth, especially with the frontend supporting up to 10 concurrent chunks per file and a finite server thread pool. Heavy concurrent uploads could potentially degrade performance for other users. The purpose of offloading to MinIO with presigned URLs is precisely to separate file transfer from application logic; the new design reintroduces that coupling and adds a server communication hop that previously did not exist. The issue doesn't seem to discuss this tradeoff in the context of issues.
5. Is this a common pattern for this use case?
Server-proxied uploads are typically used for real-time content scanning, anonymous uploads, or when the existence of the object store needs to be hidden from clients. It's not obvious that Texera's dataset upload falls into any of these categories.
As for the "watcher" idea mentioned in #4058: since the backend already holds the uploadId for each in-progress upload, a background job could periodically call ListParts to sum the already-uploaded bytes and invoke AbortMultipartUpload on any session that exceeds the size limit or has been idle too long.
It would be helpful to know whether these tradeoffs were already discussed, and whether a simpler fix was considered and ruled out for specific reasons.
@AnzhiZhang Thanks for taking the time to share such a thorough analysis. Here are some responses based on my understanding.
On the threat model: You raise a fair point that authenticated users are generally trusted. That said, the presigned URL itself carries no user identity or size restriction. It only limits the target path and expiration time. Anyone who obtains the URL could upload files without Texera authentication, so that's part of the reason for adding another layer. The probability is low, but we felt the attack surface was worth addressing.
On post-upload validation: This is a great suggestion, and we did consider it in the first iteration of file size enforcement. The concern was that by the time the finish step runs, a malicious user could have already consumed significant storage and bandwidth by uploading a very large file chunk by chunk. By proxying through File Service, we're able to enforce limits in real time during the upload rather than cleaning up after the fact.
On listParts(): Agreed that listParts() is lightweight and useful for verification. There was some earlier discussion online around potential consistency issues with relying on it too heavily, so we chose not to build deeper implementation logic around it. It is a useful function that could help reduce redundant work in certain scenarios. The newly introduced upload session/part table also enables resumable uploads with more control compared to relying on listParts(), which was another motivation for tracking part state server-side.
On the watcher approach: This is an interesting alternative and definitely worth considering. That said, it introduces additional complexity, and during the polling gap, a malicious upload could still consume substantial resources.
We understand these are tradeoffs, and your alternative approaches are certainly reasonable depending on the deployment context. In our initial testing with files in the hundreds-of-GB range, the performance impact has been reasonable so far, but we plan to do more testing on the server to be sure. This is definitely something we can revisit if upload concurrency becomes a bottleneck in production.
@carloea2 please feel free to correct me if anything is off. Thanks.
@xuang7 Thanks for the prompt reply and additional context on the tradeoffs and the performance testing results. A few follow up thoughts:
On presigned URL security: Presigned URLs are cryptographically signed and cannot be forged by someone, and we only issue them to authenticated users. The window of exposure is also limited by the expiration time. This risk is low enough for someone to obtain a URL without Texera authentication.
On the watcher approach and bandwidth consumption: Agree that a watcher adds some complexity, but given a 50 MB chunk size and a polling interval of, e.g., once per minute, the maximum wasted bandwidth before detection is bounded and modest. This seems like a reasonable tradeoff compared to proxying everything.
On listParts() and resumable uploads: I saw some consistency concerns in some discussions as well. On resumability, S3 multipart upload natively supports resuming by design. As long as the uploadId is retained, a client can pick up where it left off without any server managed session. As for upload progress tracking, it is only meaningful to the uploader and perhaps future admin users, both of whom are well intentioned. Client reported progress can be trusted for this purpose, so server-side part tracking isn't strictly necessary for that use case. That said, the session table is a reasonable design that could benefit future admin visibility, and could also support a future migration back to direct upload if needed.
On making proxy an optional configuration: One design worth considering is treating direct upload as the default and server-side proxy as an option. A global config could allow fine grained control. For example, enabling proxy only for untrusted user tiers, or toggling it site wide. I assume Texera is often self-hosted in intranet data science computing environments where they do not have untrusted users, and CPU and memory are more constrained. For those deployments, direct upload is clearly the better tradeoff and makes full use of what presigned URLs are designed for.
If there are prior discussions or constraints not aware of, happy to hear about them. Hope this is useful if the design is revisited down the line.
Activity
[-]task(dataset): Redirect multipart upload though File Service[/-][+]task(dataset): Redirect multipart upload through File Service[/+]carloea2 commentedon Dec 6, 2025
Hi, could you please share your thoughts on this new design? @bobbai00 @aglinxinyuan @xuang7
aglinxinyuan commentedon Dec 6, 2025
The design looks fine to me in general, but I do not know the details. Please let @aicam verify the design.
refactor(dataset): Redirect multipart upload through File Service (ap…
AnzhiZhang commentedon Mar 11, 2026
I came across this issue from the 1.1.0-incubating RC4 release mailing list. Before sharing some thoughts, I want to confirm my understanding of the change:
listParts()A few questions and concerns, in case they weren't already addressed in earlier discussions:
1. The threat model
Users who can upload files are authenticated. In an organization-internal deployment, most users can reasonably be assumed trusted, making this attack vector relatively low-motivation. For publicly open deployments, please see the discussion below.
2. Alternative mitigations for the size bypass
The size limit bypass described in #4058 is a valid concern. However, it seems the same goal could be achieved without proxying bytes through the server:
totalSizeBytesat init time and validating it server-sideWith this approach, even if a user bypasses the init-time check, the file would still be deleted after upload completes. The remaining risk is temporary resource exhaustion, which can be handled through user quotas and rate limiting on starting upload.
It's also worth noting that bypassing the presigned URL flow requires writing custom client code, this is deliberate malicious behavior from an authenticated user, which may warrant a different risk assessment. Additionally, while
content-length-rangecannot restrict individual multipart parts, S3 bucket policies support thes3:content-lengthcondition key, which may offer another enforcement point. It may also be possible to cap the total upload size simply by limiting the number of presigned URLs issued. For example, at 50 MB per part, issuing at most 200 URLs would effectively cap uploads at 10 GB. Whether MinIO supports these policy conditions would need verification, but seems worth exploring.3. On avoiding
listParts()It's not clear why avoiding
listParts()is listed as a benefit.listParts()or getting file stats is a straightforward way to verify per-part state and the true file size. The overhead of either call is negligible compared to the cost of routing all upload traffic through File Service.4. Server performance under the new design
Proxying byte streams through File Service will consume server CPU, memory, and network bandwidth, especially with the frontend supporting up to 10 concurrent chunks per file and a finite server thread pool. Heavy concurrent uploads could potentially degrade performance for other users. The purpose of offloading to MinIO with presigned URLs is precisely to separate file transfer from application logic; the new design reintroduces that coupling and adds a server communication hop that previously did not exist. The issue doesn't seem to discuss this tradeoff in the context of issues.
5. Is this a common pattern for this use case?
Server-proxied uploads are typically used for real-time content scanning, anonymous uploads, or when the existence of the object store needs to be hidden from clients. It's not obvious that Texera's dataset upload falls into any of these categories.
6. On the watcher approach from #4058
As for the "watcher" idea mentioned in #4058: since the backend already holds the
uploadIdfor each in-progress upload, a background job could periodically callListPartsto sum the already-uploaded bytes and invokeAbortMultipartUploadon any session that exceeds the size limit or has been idle too long.It would be helpful to know whether these tradeoffs were already discussed, and whether a simpler fix was considered and ruled out for specific reasons.
xuang7 commentedon Mar 11, 2026
@AnzhiZhang Thanks for taking the time to share such a thorough analysis. Here are some responses based on my understanding.
File Service, we're able to enforce limits in real time during the upload rather than cleaning up after the fact.listParts(): Agreed thatlistParts()is lightweight and useful for verification. There was some earlier discussion online around potential consistency issues with relying on it too heavily, so we chose not to build deeper implementation logic around it. It is a useful function that could help reduce redundant work in certain scenarios. The newly introducedupload session/part tablealso enables resumable uploads with more control compared to relying onlistParts(), which was another motivation for tracking part state server-side.We understand these are tradeoffs, and your alternative approaches are certainly reasonable depending on the deployment context. In our initial testing with files in the hundreds-of-GB range, the performance impact has been reasonable so far, but we plan to do more testing on the server to be sure. This is definitely something we can revisit if upload concurrency becomes a bottleneck in production.
@carloea2 please feel free to correct me if anything is off. Thanks.
carloea2 commentedon Mar 11, 2026
I don't have comments on this.
AnzhiZhang commentedon Mar 11, 2026
@xuang7 Thanks for the prompt reply and additional context on the tradeoffs and the performance testing results. A few follow up thoughts:
On presigned URL security: Presigned URLs are cryptographically signed and cannot be forged by someone, and we only issue them to authenticated users. The window of exposure is also limited by the expiration time. This risk is low enough for someone to obtain a URL without Texera authentication.
On the watcher approach and bandwidth consumption: Agree that a watcher adds some complexity, but given a 50 MB chunk size and a polling interval of, e.g., once per minute, the maximum wasted bandwidth before detection is bounded and modest. This seems like a reasonable tradeoff compared to proxying everything.
On
listParts()and resumable uploads: I saw some consistency concerns in some discussions as well. On resumability, S3 multipart upload natively supports resuming by design. As long as theuploadIdis retained, a client can pick up where it left off without any server managed session. As for upload progress tracking, it is only meaningful to the uploader and perhaps future admin users, both of whom are well intentioned. Client reported progress can be trusted for this purpose, so server-side part tracking isn't strictly necessary for that use case. That said, the session table is a reasonable design that could benefit future admin visibility, and could also support a future migration back to direct upload if needed.On making proxy an optional configuration: One design worth considering is treating direct upload as the default and server-side proxy as an option. A global config could allow fine grained control. For example, enabling proxy only for untrusted user tiers, or toggling it site wide. I assume Texera is often self-hosted in intranet data science computing environments where they do not have untrusted users, and CPU and memory are more constrained. For those deployments, direct upload is clearly the better tradeoff and makes full use of what presigned URLs are designed for.
If there are prior discussions or constraints not aware of, happy to hear about them. Hope this is useful if the design is revisited down the line.
refactor(dataset): Redirect multipart upload through File Service (ap…
refactor(dataset): Redirect multipart upload through File Service (ap…