Browse Source

normal if no partitions found

pull/7185/head
chrislu 1 month ago
parent
commit
43f8332297
  1. 5
      weed/query/engine/hybrid_message_scanner.go

5
weed/query/engine/hybrid_message_scanner.go

@ -446,9 +446,10 @@ func (hms *HybridMessageScanner) discoverTopicPartitions(ctx context.Context) ([
return nil, fmt.Errorf("failed to scan topic directory for partitions: %v", err) return nil, fmt.Errorf("failed to scan topic directory for partitions: %v", err)
} }
// If no partitions found, return error instead of masking the issue
// If no partitions found, return empty slice (valid for newly created or empty topics)
if len(allPartitions) == 0 { if len(allPartitions) == 0 {
return nil, fmt.Errorf("no partitions found for topic %s", hms.topic.String())
fmt.Printf("No partitions found for topic %s - returning empty result set\n", hms.topic.String())
return []topic.Partition{}, nil
} }
fmt.Printf("Discovered %d partitions for topic %s\n", len(allPartitions), hms.topic.String()) fmt.Printf("Discovered %d partitions for topic %s\n", len(allPartitions), hms.topic.String())

Loading…
Cancel
Save