forked from apache/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[java client] Tight-ish loop in master lookups if a tablet doesn't ha…
…ve a leader There's currently the possibility of a situation like this: 1. sendRpcToTablet finds the tablet that the RPC is going to doesn't have a leader 2. a master lookup is sent 3. discoverTablet is called back and still doesn't find a leader 4. RetryRpcCallback is invoked right away, going back to step 1 This quickly gets us with this exception: Too many attempts: KuduRpc(method=Write, tablet=redacted, attempt=101, DeadlineTracker(timeout=30000, elapsed=4747) Notice how it retried 101 times in less than 5 seconds. This patch changes step 3 so that an exception is thrown so that RetryRpcErrback is invoked instead, which will add delay before retrying the RPC. This bug was found by ITClient. It's not _just_ a flaky test! Change-Id: Ibf2bd53b03551642e4d036d322e1e592b7c2cfec Reviewed-on: http://gerrit.cloudera.org:8080/4570 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Jean-Daniel Cryans <[email protected]>
- Loading branch information
Showing
3 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
java/kudu-client/src/main/java/org/apache/kudu/client/NoSuitableReplicaException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
package org.apache.kudu.client; | ||
|
||
/** | ||
* Indicates that the master lookup failed because no suitable replicas were found for | ||
* the given RPC. | ||
*/ | ||
final class NoSuitableReplicaException extends RecoverableException { | ||
|
||
NoSuitableReplicaException(Status status) { | ||
super(status); | ||
} | ||
|
||
NoSuitableReplicaException(Status status, Exception cause) { | ||
super(status, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters