milvus/internal/querycoordv2/observers
yiwangdr 32cff25f97
enhance: decrease coordinator init time (#29822)
This PR mainly improve two items:
1. Target observer should refresh loading status during init time. An
uninitialized loading status blocks search/query. Currently, the target
observer refreshes every 10 seconds, i.e. we'd need to wait for 10s for
no reason. That's also the reason why we constantly see false log
"collection unloaded" upon mixcoord restarts.
2. Delete session when service is stopped. So that the new service
doesn't need to wait for the previous session to expire (~10s).

Item 1 is the major improvement of this PR, which should speed up init
time by 10s.
Item 2 is not a big concern in most cases as coordinators usually shut
down after stop(). In those cases, coordinator restart triggers serverID
change which further triggers an existing logic that deletes expired
session. This PR only fixes rare cases where serverID doesn't change.

integration test:
`go test -tags dynamic -v -coverprofile=profile.out -covermode=atomic
tests/integration/coordrecovery/coord_recovery_test.go -timeout=20m`
Performance after the change:
Average init time of coordinators: 10s
Hardware: M2 Pro
Test setup: 1000 collections with 1000 rows (dim=128) per collection.


issue: #29409

Signed-off-by: yiwangdr <yiwangdr@gmail.com>
2024-02-05 14:00:12 +08:00
..
collection_observer_test.go enhance: refactor leader_observer to leader_checker (#29454) 2024-01-05 15:54:55 +08:00
collection_observer.go enhance: Change some frequency log to rated level (#29720) 2024-01-11 16:30:50 +08:00
OWNERS Add OWNERS files for querycoordv2 sub pkgs (#23489) 2023-04-18 15:52:30 +08:00
replica_observer_test.go Refine QueryCoord stopping (#27371) 2023-09-27 16:27:27 +08:00
replica_observer.go Refine QueryCoord stopping (#27371) 2023-09-27 16:27:27 +08:00
resource_observer_test.go Refine QueryCoord stopping (#27371) 2023-09-27 16:27:27 +08:00
resource_observer.go Refine QueryCoord stopping (#27371) 2023-09-27 16:27:27 +08:00
target_observer_test.go fix: sync action load segment with lack collection index info list (#28788) 2023-12-04 18:14:34 +08:00
target_observer.go enhance: decrease coordinator init time (#29822) 2024-02-05 14:00:12 +08:00
task_dispatcher_test.go fix: make qcv2 observer dispatcher execute exactly once (#28472) 2023-11-16 10:24:19 +08:00
task_dispatcher.go fix: load gets stuck probably (#29191) 2023-12-14 18:28:38 +08:00