Skip to content

Commit

Permalink
[fix](statistics) NPE when drop partition during publish (apache#35475)
Browse files Browse the repository at this point in the history
skip null partition when get base tablets for each be (for further usage
in dedup updated row count in MV)
This may cause publish fail
  • Loading branch information
freemandealer authored May 28, 2024
1 parent 6fc1221 commit 02fd95a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -262,7 +263,9 @@ private Map<Long, Set<Long>> getBaseTabletIdsForEachBe(TransactionState transact
.getIdToPartitionCommitInfo()
.values().stream()
.map(PartitionCommitInfo::getPartitionId)
.map(table::getPartition)
.map(partitionId -> Optional.ofNullable(table.getPartition(partitionId)))
.filter(Optional::isPresent)
.map(Optional::get)
.map(Partition::getBaseIndex)
.map(MaterializedIndex::getTablets)
.flatMap(Collection::stream)
Expand Down

0 comments on commit 02fd95a

Please sign in to comment.