Conversation
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
| setIfMissing(TIKV_METRICS_ENABLE, DEF_METRICS_ENABLE); | ||
| setIfMissing(TIKV_METRICS_PORT, DEF_METRICS_PORT); | ||
| setIfMissing(TIKV_NETWORK_MAPPING_NAME, DEF_TIKV_NETWORK_MAPPING_NAME); | ||
| setIfMissing(TIKV_ENABLE_GRPC_FORWARD, false); |
There was a problem hiding this comment.
Looks like you'd better define a DEF_ENABLE_GRPC_FORWARD
| if (checkHealth(store)) { | ||
| return true; | ||
| } else { | ||
| store.invalid(); |
There was a problem hiding this comment.
Does the function invalid actually means invalidate?
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(TiConfiguration.class); | ||
| private static final ConcurrentHashMap<String, String> settings = new ConcurrentHashMap<>(); | ||
| public static final Metadata.Key FORWARD_META_DATA_KEY = |
There was a problem hiding this comment.
| public static final Metadata.Key FORWARD_META_DATA_KEY = | |
| public static final Metadata.Key FORWARD_METADATA_KEY = |
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
| public static final boolean DEF_METRICS_ENABLE = false; | ||
| public static final int DEF_METRICS_PORT = 3140; | ||
| public static final String DEF_TIKV_NETWORK_MAPPING_NAME = ""; | ||
| public static final boolean DEF_GRPC_FORWARD_ENABLE = true; |
MyonKeminta
left a comment
There was a problem hiding this comment.
Rest LGTM, but I'm not very confident. Please confirm it works by tests.
| TiStore oldStore = this.stores.get(Long.valueOf(store.getId())); | ||
| if (oldStore != null) { | ||
| return; | ||
| } | ||
| synchronized (this.taskQueue) { | ||
| this.stores.put(Long.valueOf(store.getId()), store); | ||
| this.taskQueue.add(store); | ||
| } |
There was a problem hiding this comment.
Is this function possible to be called concurrently? May it be a race that multiple threads do the check-and-insert-if-not-exist operation at the same time?
| continue; | ||
| } | ||
| } finally { | ||
| } |
There was a problem hiding this comment.
What's the purpose of the try-finally?
| List<TiStore> unhealthStore = getUnhealthStore(); | ||
| List<TiStore> restStore = new LinkedList<>(); | ||
| for (TiStore store : unhealthStore) { | ||
| String addressStr = store.getStore().getAddress(); |
There was a problem hiding this comment.
Did you check if the store becomes tombstone?
There was a problem hiding this comment.
No, the store will not be tombstone after it was created. Because it is a final object.
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
cherry pick to release-3.1 in PR #208 |
* support grpc forward for tikv client Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
* support grpc forward for tikv client Signed-off-by: Little-Wallace <bupt2013211450@gmail.com> Signed-off-by: birdstorm <samuelwyf@hotmail.com>
* Support grpc forward (#198) * support grpc forward for tikv client Signed-off-by: Little-Wallace <bupt2013211450@gmail.com> Signed-off-by: birdstorm <samuelwyf@hotmail.com> * fix compile Signed-off-by: birdstorm <samuelwyf@hotmail.com> Co-authored-by: Wallace <bupt2013211450@gmail.com> Co-authored-by: birdstorm <samuelwyf@hotmail.com>
What problem does this PR solve?
When TiKV cluster deploy in three IDC A/B/C, if there is network isolation between the A and B, the message which should be send to leader in A can be forward by B.
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes