You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Ted-Jiang (via GitHub)" <gi...@apache.org> on 2023/04/10 06:21:22 UTC
[GitHub] [arrow-ballista] Ted-Jiang opened a new pull request, #738: [feature] support shuffle read with retry when facing IO error.
Ted-Jiang opened a new pull request, #738:
URL: https://github.com/apache/arrow-ballista/pull/738
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #737 .
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Ted-Jiang commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1162258931
##########
ballista/core/src/client.rs:
##########
@@ -43,16 +43,19 @@ use crate::serde::protobuf;
use crate::utils::create_grpc_client_connection;
use datafusion::physical_plan::{RecordBatchStream, SendableRecordBatchStream};
use futures::{Stream, StreamExt};
-use log::debug;
+use log::{debug, warn};
use prost::Message;
-use tonic::Streaming;
+use tonic::{Code, Streaming};
/// Client for interacting with Ballista executors.
#[derive(Clone)]
pub struct BallistaClient {
flight_client: FlightServiceClient<tonic::transport::channel::Channel>,
}
+const IO_RETRIES_TIMES: u8 = 3;
+const IO_RETRY_WAIT_TIME_MS: u64 = 3000;
Review Comment:
Will add this, when support global config.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Ted-Jiang commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1161557758
##########
ballista/core/src/client.rs:
##########
@@ -117,32 +120,69 @@ impl BallistaClient {
.encode(&mut buf)
.map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?;
- let request = tonic::Request::new(Ticket { ticket: buf.into() });
-
- let mut stream = self
- .flight_client
- .do_get(request)
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- .into_inner();
+ for i in 0..IO_RETRIES_TIMES {
+ if i > 0 {
+ warn!(
+ "Remote shuffle read fail, retry {} times, sleep {} ms.",
+ i, IO_RETRY_WAIT_TIME_MS
+ );
+ tokio::time::sleep(std::time::Duration::from_millis(
+ IO_RETRY_WAIT_TIME_MS,
+ ))
+ .await;
+ }
- // the schema should be the first message returned, else client should error
- match stream
- .message()
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- {
- Some(flight_data) => {
- // convert FlightData to a stream
- let schema = Arc::new(Schema::try_from(&flight_data)?);
-
- // all the remaining stream messages should be dictionary and record batches
- Ok(Box::pin(FlightDataStream::new(stream, schema)))
+ let request = tonic::Request::new(Ticket {
+ ticket: buf.clone().into(),
+ });
+ let result = self.flight_client.do_get(request).await;
+
+ let res = match result {
+ Ok(res) => res,
+ Err(ref err) => {
+ // IO related error like connection timeout, reset... will warp with Code::Unknown
Review Comment:
ConnectionReset need retry use `Unknown` type
```
(Execution("FetchFailed(\"10.xx.xxx.14\", \"37258e22-f50e-482b-9c0d-d1e84b83d5e5\", 3, 2, \"Status { code: Unknown, message: \\\"transport error\\\", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Kind(ConnectionReset)))) }\")"))
```
NotSuchFile use `Internal`
```
DataFusion error: ArrowError(ExternalError("Arrow error: External error: Shuffle fetch partition error from Executor 10.xx.xxx.146 : ff16a886-ca14-4a1b-bdc3-560c6adf699c, map_stage 2, map_partition 18, error desc: Status { code: Internal, message: \"Ballista Error: General(\\\"Failed to open partition file at /home
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] yahoNanJing commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "yahoNanJing (via GitHub)" <gi...@apache.org>.
yahoNanJing commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1162258404
##########
ballista/core/src/client.rs:
##########
@@ -117,32 +120,69 @@ impl BallistaClient {
.encode(&mut buf)
.map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?;
- let request = tonic::Request::new(Ticket { ticket: buf.into() });
-
- let mut stream = self
- .flight_client
- .do_get(request)
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- .into_inner();
+ for i in 0..IO_RETRIES_TIMES {
Review Comment:
Maybe better to extract the retry logic into a function to get the `FlightData`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Ted-Jiang commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1161557758
##########
ballista/core/src/client.rs:
##########
@@ -117,32 +120,69 @@ impl BallistaClient {
.encode(&mut buf)
.map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?;
- let request = tonic::Request::new(Ticket { ticket: buf.into() });
-
- let mut stream = self
- .flight_client
- .do_get(request)
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- .into_inner();
+ for i in 0..IO_RETRIES_TIMES {
+ if i > 0 {
+ warn!(
+ "Remote shuffle read fail, retry {} times, sleep {} ms.",
+ i, IO_RETRY_WAIT_TIME_MS
+ );
+ tokio::time::sleep(std::time::Duration::from_millis(
+ IO_RETRY_WAIT_TIME_MS,
+ ))
+ .await;
+ }
- // the schema should be the first message returned, else client should error
- match stream
- .message()
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- {
- Some(flight_data) => {
- // convert FlightData to a stream
- let schema = Arc::new(Schema::try_from(&flight_data)?);
-
- // all the remaining stream messages should be dictionary and record batches
- Ok(Box::pin(FlightDataStream::new(stream, schema)))
+ let request = tonic::Request::new(Ticket {
+ ticket: buf.clone().into(),
+ });
+ let result = self.flight_client.do_get(request).await;
+
+ let res = match result {
+ Ok(res) => res,
+ Err(ref err) => {
+ // IO related error like connection timeout, reset... will warp with Code::Unknown
Review Comment:
ConnectionReset need retry use `Unknown` type
```
(Execution("FetchFailed(\"10.69.148.14\", \"37258e22-f50e-482b-9c0d-d1e84b83d5e5\", 3, 2, \"Status { code: Unknown, message: \\\"transport error\\\", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Kind(ConnectionReset)))) }\")"))
```
NotSuchFile use `Internal`
```
DataFusion error: ArrowError(ExternalError("Arrow error: External error: Shuffle fetch partition error from Executor 10.69.147.146 : ff16a886-ca14-4a1b-bdc3-560c6adf699c, map_stage 2, map_partition 18, error desc: Status { code: Internal, message: \"Ballista Error: General(\\\"Failed to open partition file at /home
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Ted-Jiang commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1161557758
##########
ballista/core/src/client.rs:
##########
@@ -117,32 +120,69 @@ impl BallistaClient {
.encode(&mut buf)
.map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?;
- let request = tonic::Request::new(Ticket { ticket: buf.into() });
-
- let mut stream = self
- .flight_client
- .do_get(request)
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- .into_inner();
+ for i in 0..IO_RETRIES_TIMES {
+ if i > 0 {
+ warn!(
+ "Remote shuffle read fail, retry {} times, sleep {} ms.",
+ i, IO_RETRY_WAIT_TIME_MS
+ );
+ tokio::time::sleep(std::time::Duration::from_millis(
+ IO_RETRY_WAIT_TIME_MS,
+ ))
+ .await;
+ }
- // the schema should be the first message returned, else client should error
- match stream
- .message()
- .await
- .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?
- {
- Some(flight_data) => {
- // convert FlightData to a stream
- let schema = Arc::new(Schema::try_from(&flight_data)?);
-
- // all the remaining stream messages should be dictionary and record batches
- Ok(Box::pin(FlightDataStream::new(stream, schema)))
+ let request = tonic::Request::new(Ticket {
+ ticket: buf.clone().into(),
+ });
+ let result = self.flight_client.do_get(request).await;
+
+ let res = match result {
+ Ok(res) => res,
+ Err(ref err) => {
+ // IO related error like connection timeout, reset... will warp with Code::Unknown
Review Comment:
ConnectionReset need retry use `Unknown` type
```
(Execution("FetchFailed(\"127.0.0.1\", \"37258e22-f50e-482b-9c0d-d1e84b83d5e5\", 3, 2, \"Status { code: Unknown, message: \\\"transport error\\\", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Kind(ConnectionReset)))) }\")"))
```
NotSuchFile use `Internal`
```
DataFusion error: ArrowError(ExternalError("Arrow error: External error: Shuffle fetch partition error from Executor 127.0.0. : ff16a886-ca14-4a1b-bdc3-560c6adf699c, map_stage 2, map_partition 18, error desc: Status { code: Internal, message: \"Ballista Error: General(\\\"Failed to open partition file at /home
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] yahoNanJing commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "yahoNanJing (via GitHub)" <gi...@apache.org>.
yahoNanJing commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1162258648
##########
ballista/core/src/client.rs:
##########
@@ -43,16 +43,19 @@ use crate::serde::protobuf;
use crate::utils::create_grpc_client_connection;
use datafusion::physical_plan::{RecordBatchStream, SendableRecordBatchStream};
use futures::{Stream, StreamExt};
-use log::debug;
+use log::{debug, warn};
use prost::Message;
-use tonic::Streaming;
+use tonic::{Code, Streaming};
/// Client for interacting with Ballista executors.
#[derive(Clone)]
pub struct BallistaClient {
flight_client: FlightServiceClient<tonic::transport::channel::Channel>,
}
+const IO_RETRIES_TIMES: u8 = 3;
+const IO_RETRY_WAIT_TIME_MS: u64 = 3000;
Review Comment:
Better to make these configurations configurable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Ted-Jiang merged pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang merged PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Ted-Jiang commented on a diff in pull request #738: [feature] support shuffle read with retry when facing IO error.
Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang commented on code in PR #738:
URL: https://github.com/apache/arrow-ballista/pull/738#discussion_r1162258931
##########
ballista/core/src/client.rs:
##########
@@ -43,16 +43,19 @@ use crate::serde::protobuf;
use crate::utils::create_grpc_client_connection;
use datafusion::physical_plan::{RecordBatchStream, SendableRecordBatchStream};
use futures::{Stream, StreamExt};
-use log::debug;
+use log::{debug, warn};
use prost::Message;
-use tonic::Streaming;
+use tonic::{Code, Streaming};
/// Client for interacting with Ballista executors.
#[derive(Clone)]
pub struct BallistaClient {
flight_client: FlightServiceClient<tonic::transport::channel::Channel>,
}
+const IO_RETRIES_TIMES: u8 = 3;
+const IO_RETRY_WAIT_TIME_MS: u64 = 3000;
Review Comment:
Will fix this, when support global config.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org