-
Notifications
You must be signed in to change notification settings - Fork 117
seek leader/proxy store early abort #550
Copy link
Copy link
Closed
Labels
type/bugSomething isn't workingSomething isn't working
Description
Bug Report
1. Describe the bug
If seekLeaderStore or seekProxyStore encounter a region that peer list contains an abnormal store, like in tombstone state, will trigger an InvalidStoreException which is not handled properly cause the rest of peers will not be probed.
2. Minimal reproduce step (Required)
It can be described by the following unit test.
@Test
public void testSeekLeaderMeetInvalidStore() {
RawKVClient client = createClient();
ByteString key = ByteString.copyFromUtf8("key");
ByteString value = ByteString.copyFromUtf8("value");
put(key, value);
servers.get(0).setState(State.Fail);
servers.get(2).setRegion(region.switchPeer(stores.get(2).getId()));
AtomicInteger i = new AtomicInteger(0);
pdLeader.addGetStoreListener(
request -> {
Metapb.Store.Builder storeBuilder =
Metapb.Store.newBuilder().mergeFrom(stores.get((int) request.getStoreId() - 1));
if (request.getStoreId() == 0x2 && i.incrementAndGet() > 0) {
storeBuilder.setState(StoreState.Tombstone);
}
return Pdpb.GetStoreResponse.newBuilder().setStore(storeBuilder.build()).build();
});
Assert.assertEquals(value, client.get(key).get());
remove(key, value);
}3. What are your Java Client and TiKV versions? (Required)
- Client Java: master
- TiKV: v5.0.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/bugSomething isn't workingSomething isn't working