[
https://issues.apache.org/jira/browse/CASSSIDECAR-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18032841#comment-18032841
]
Yifan Cai commented on CASSSIDECAR-359:
---------------------------------------
+1
> Avoid resuming stream during SSTable upload
> -------------------------------------------
>
> Key: CASSSIDECAR-359
> URL: https://issues.apache.org/jira/browse/CASSSIDECAR-359
> Project: Sidecar for Apache Cassandra
> Issue Type: Bug
> Components: Rest API
> Reporter: Francisco Guerrero
> Assignee: Francisco Guerrero
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> During SSTable upload in Sidecar,
> {{org.apache.cassandra.sidecar.utils.SSTableUploader}} resumes the “paused”
> stream too early, and could cause issues between the time the stream is
> resumed and the stream needs to be consumed.
> The issue is subtle, but could occur under a loaded system. Sidecar will try
> to pipe the stream into a file during the upload, but if resuming the stream
> too early then the stream bytes will be read before we have a chance to pipe
> them into the file and this is reflected by the following exception:
> {code:java}
> io.vertx.ext.web.handler.HttpException: Internal Server Error
> Caused by: java.lang.IllegalStateException: Request has already been read
> at
> io.vertx.core.http.impl.Http1xServerRequest.checkEnded(Http1xServerRequest.java:733)
> at
> io.vertx.core.http.impl.Http1xServerRequest.endHandler(Http1xServerRequest.java:407)
> at
> io.vertx.core.http.impl.HttpServerRequestWrapper.endHandler(HttpServerRequestWrapper.java:83)
> at
> io.vertx.core.http.impl.HttpServerRequestWrapper.endHandler(HttpServerRequestWrapper.java:45)
> at io.vertx.core.streams.impl.PipeImpl.<init>(PipeImpl.java:35)
> at io.vertx.core.streams.ReadStream.pipeTo(ReadStream.java:123)
> at
> org.apache.cassandra.sidecar.utils.SSTableUploader.pipeStreamToFile(SSTableUploader.java:121)
> at
> org.apache.cassandra.sidecar.handlers.sstableuploads.BaseUploadsHandlerTest$TestModuleOverride$1.lambda$pipeStreamToFile$0(BaseUploadsHandlerTest.java:240)
> {code}
> Instead, we should let the resuming to take place when the stream is ready to
> be piped into the file.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]