Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: avoid issuing requests to shards that we know are erroring
For sharded requests, we often need to load the metadata to perform a lookup and then issue a request that will ultimately end up failing. Previously, the assumption was that this would be fine: we would issue a request, it would fail with a retriable error (NOT_LEADER_FOR_PARTITION or something), and then we would re-shard, at which time we could hope that the metadata would load the partition successfully. Well, that wastes time and leads to unclear error messages The new behavior is to return an error shard with a portion of the request that we are not issuing, and then avoid looping at all. This new behavior uses a bunch of reflect magic to simplify actual usage. Most of the sharding functions are pretty much copy&paste, so simplifying things with reflect up top allows us to copy&paste less. Only one function cannot use our new reflect magic helper, the describe log dirs sharder.
- Loading branch information