From e7edd63446e35da1c3b9b30aedeef8270473d0a8 Mon Sep 17 00:00:00 2001 From: Victor1319 Date: Wed, 21 May 2025 17:41:26 +0800 Subject: [PATCH] fix(data): avoid replicas empty when buildDataPartitionRepairTask. #1000134827 Signed-off-by: Victor1319 --- datanode/data_partition_repair.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datanode/data_partition_repair.go b/datanode/data_partition_repair.go index 505ce0663..69c710d7f 100644 --- a/datanode/data_partition_repair.go +++ b/datanode/data_partition_repair.go @@ -157,6 +157,10 @@ func (dp *DataPartition) repair(extentType uint8) { } func (dp *DataPartition) buildDataPartitionRepairTask(repairTasks []*DataPartitionRepairTask, extentType uint8, tinyExtents []uint64, replica []string) (err error) { + if len(repairTasks) == 0 { + return fmt.Errorf("dp replica is empty. dp %d, replicas %v", dp.partitionID, dp.replicas) + } + // get the local extent info extents, leaderTinyDeleteRecordFileSize, err := dp.getLocalExtentInfo(extentType, tinyExtents) if err != nil {