SteNicholas commented on code in PR #3583:
URL: https://github.com/apache/celeborn/pull/3583#discussion_r2706583335
##########
cpp/celeborn/client/reader/CelebornInputStream.cpp:
##########
@@ -189,9 +196,45 @@ void CelebornInputStream::moveToNextReader() {
std::shared_ptr<PartitionReader> CelebornInputStream::createReaderWithRetry(
const protocol::PartitionLocation& location) {
- // TODO: support retrying when createReader failed. Maybe switch to peer
- // location?
- return createReader(location);
+ const protocol::PartitionLocation* currentLocation = &location;
+ std::exception_ptr lastException;
+
+ while (fetchChunkRetryCnt_ < fetchChunkMaxRetry_) {
+ try {
+ VLOG(1) << "Create reader for location " << currentLocation->host << ":"
+ << currentLocation->fetchPort;
+ auto reader = createReader(*currentLocation);
+ fetchChunkRetryCnt_ = 0;
+ return reader;
+ } catch (const std::exception& e) {
+ lastException = std::current_exception();
+ fetchChunkRetryCnt_++;
Review Comment:
The shuffle client should exclude failed fetch location.
##########
cpp/celeborn/client/reader/CelebornInputStream.cpp:
##########
@@ -189,9 +196,45 @@ void CelebornInputStream::moveToNextReader() {
std::shared_ptr<PartitionReader> CelebornInputStream::createReaderWithRetry(
const protocol::PartitionLocation& location) {
- // TODO: support retrying when createReader failed. Maybe switch to peer
- // location?
- return createReader(location);
+ const protocol::PartitionLocation* currentLocation = &location;
+ std::exception_ptr lastException;
+
+ while (fetchChunkRetryCnt_ < fetchChunkMaxRetry_) {
+ try {
+ VLOG(1) << "Create reader for location " << currentLocation->host << ":"
+ << currentLocation->fetchPort;
+ auto reader = createReader(*currentLocation);
Review Comment:
This should check whether the partition location is excluded, which aligns
with the logic of `CelebornInputStream#createReaderWithRetry`.
##########
cpp/celeborn/client/reader/CelebornInputStream.cpp:
##########
@@ -189,9 +196,45 @@ void CelebornInputStream::moveToNextReader() {
std::shared_ptr<PartitionReader> CelebornInputStream::createReaderWithRetry(
const protocol::PartitionLocation& location) {
- // TODO: support retrying when createReader failed. Maybe switch to peer
- // location?
- return createReader(location);
+ const protocol::PartitionLocation* currentLocation = &location;
+ std::exception_ptr lastException;
+
+ while (fetchChunkRetryCnt_ < fetchChunkMaxRetry_) {
+ try {
+ VLOG(1) << "Create reader for location " << currentLocation->host << ":"
+ << currentLocation->fetchPort;
+ auto reader = createReader(*currentLocation);
+ fetchChunkRetryCnt_ = 0;
+ return reader;
+ } catch (const std::exception& e) {
+ lastException = std::current_exception();
+ fetchChunkRetryCnt_++;
+
+ if (currentLocation->hasPeer()) {
+ if (fetchChunkRetryCnt_ % 2 == 0) {
+ std::this_thread::sleep_for(
+ std::chrono::milliseconds(retryWait_.count()));
+ }
+ LOG(WARNING) << "CreatePartitionReader failed " << fetchChunkRetryCnt_
Review Comment:
Does this aligin with the failure handling of
`CelebornInputStream#createReaderWithRetry`?
##########
cpp/celeborn/conf/CelebornConf.h:
##########
@@ -176,6 +185,12 @@ class CelebornConf : public BaseConf {
protocol::CompressionCodec shuffleCompressionCodec() const;
int shuffleCompressionZstdCompressLevel() const;
+
+ int clientFetchMaxRetriesForEachReplica() const;
+
+ Timeout dataIoRetryWait() const;
Review Comment:
Could this method name align with `CelebornConf#networkIoRetryWaitMs` for io
wait conf of all modules?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]