Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resolve the cache invalidation of the partition->leader shard in ClientCache
  • Loading branch information
haohao0103 committed Jul 15, 2024
1 parent 03b40a5 commit 2e77882
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public void reset() {
groups = new ConcurrentHashMap<>();
stores = new ConcurrentHashMap<>();
caches = new ConcurrentHashMap<>();
initialized.set(false);
}

public Shard getLeader(int partitionId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,9 @@ private KVPair<Metapb.Partition, Metapb.Shard> getKvPair(String graphName, byte[
*/
public KVPair<Metapb.Partition, Metapb.Shard> getPartition(String graphName, byte[] key) throws
PDException {
KVPair<Metapb.Partition, Metapb.Shard> partShard = cache.getPartitionByKey(graphName, key);

KVPair<Metapb.Partition, Metapb.Shard> partShard =
this.getPartitionByCode(graphName, PartitionUtils.calcHashcode(key));
partShard = getKvPair(graphName, key, partShard);
return partShard;
}
Expand Down

0 comments on commit 2e77882

Please sign in to comment.