search child shards in DDB instead of in local cache

This commit is contained in:
Chunxue Yang 2020-06-17 11:31:22 -07:00
parent 50a1fe8922
commit 27613763ac

View file

@ -246,7 +246,7 @@ public class ShutdownTask implements ConsumerTask {
throws DependencyException, InvalidStateException, ProvisionedThroughputException {
for(ChildShard childShard : childShards) {
final String leaseKey = ShardInfo.getLeaseKey(shardInfo, childShard.shardId());
if(leaseCoordinator.getCurrentlyHeldLease(leaseKey) == null) {
if(leaseCoordinator.leaseRefresher().getLease(leaseKey) == null) {
final Lease leaseToCreate = hierarchicalShardSyncer.createLeaseForChildShard(childShard, shardDetector.streamIdentifier());
leaseCoordinator.leaseRefresher().createLeaseIfNotExists(leaseToCreate);
log.info("Shard {}: Created child shard lease: {}", shardInfo.shardId(), leaseToCreate.leaseKey());