SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
refactor
chrislub6fd1ff4ce36
diff --git a/weed/mq/topic/local_manager.go b/weed/mq/topic/local_manager.goindex 44e629fc1c..91081c6021 100644--- a/weed/mq/topic/local_manager.go+++ b/weed/mq/topic/local_manager.go@@ -28,10 +28,7 @@ func (manager *LocalTopicManager) AddLocalPartition(topic Topic, localPartitionif !manager.topics.SetIfAbsent(topic.String(), localTopic) {localTopic, _ = manager.topics.Get(topic.String())}- if localTopic.findPartition(localPartition.Partition) != nil {- return- }- localTopic.Partitions = append(localTopic.Partitions, localPartition)+ localTopic.AddPartition(localPartition)}// GetLocalPartition gets a topic from the local topic managerdiff --git a/weed/mq/topic/local_topic.go b/weed/mq/topic/local_topic.goindex 8ab2a0db50..35e3137424 100644--- a/weed/mq/topic/local_topic.go+++ b/weed/mq/topic/local_topic.go@@ -37,6 +37,12 @@ func (localTopic *LocalTopic) removePartition(partition Partition) bool {localTopic.Partitions = append(localTopic.Partitions[:foundPartitionIndex], localTopic.Partitions[foundPartitionIndex+1:]...)return true}+func (localTopic *LocalTopic) AddPartition(localPartition *LocalPartition) {+ if localTopic.findPartition(localPartition.Partition) != nil {+ return+ }+ localTopic.Partitions = append(localTopic.Partitions, localPartition)+}func (localTopic *LocalTopic) closePartitionPublishers(unixTsNs int64) bool {var wg sync.WaitGroup