From 25c96991f68e437ac49f91cafdf9ec93253fa6f5 Mon Sep 17 00:00:00 2001 From: wei liu Date: Mon, 11 Nov 2024 17:50:30 +0800 Subject: [PATCH] fix: Lost loading collection's updateTs after qc restart (#37538) (#37580) issue: #37537 pr: #37538 Signed-off-by: Wei Liu --- internal/querycoordv2/meta/collection_manager.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/querycoordv2/meta/collection_manager.go b/internal/querycoordv2/meta/collection_manager.go index dd0251a85f2ad..9234ac23ba8e4 100644 --- a/internal/querycoordv2/meta/collection_manager.go +++ b/internal/querycoordv2/meta/collection_manager.go @@ -182,9 +182,11 @@ func (m *CollectionManager) Recover(broker Broker) error { } } - m.collections[collection.CollectionID] = &Collection{ + // update collection's CreateAt and UpdateAt to now after qc restart + m.putCollection(false, &Collection{ CollectionLoadInfo: collection, - } + CreatedAt: time.Now(), + }) } for collection, partitions := range partitions { @@ -200,13 +202,19 @@ func (m *CollectionManager) Recover(broker Broker) error { } partition.RecoverTimes += 1 - m.putPartition([]*Partition{{PartitionLoadInfo: partition}}, true) + m.putPartition([]*Partition{ + { + PartitionLoadInfo: partition, + CreatedAt: time.Now(), + }, + }, true) continue } m.putPartition([]*Partition{ { PartitionLoadInfo: partition, + CreatedAt: time.Now(), }, }, false) }