mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
When the main dispatcher has not yet consumed data, curTs is 0. During this time, merging dispatchers should not be allowed; otherwise, the data of the solo dispatcher will be skipped. issue: https://github.com/milvus-io/milvus/issues/34255 pr: https://github.com/milvus-io/milvus/pull/34562 Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
7f3a2a278f
commit
c46fccb3e9
@ -183,7 +183,7 @@ func (c *dispatcherManager) tryMerge() {
|
||||
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
if c.mainDispatcher == nil {
|
||||
if c.mainDispatcher == nil || c.mainDispatcher.CurTs() == 0 {
|
||||
return
|
||||
}
|
||||
candidates := make(map[string]struct{})
|
||||
|
||||
@ -71,6 +71,12 @@ func TestManager(t *testing.T) {
|
||||
_, err = c.Add(ctx, "mock_vchannel_2", nil, mqwrapper.SubscriptionPositionUnknown)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 3, c.Num())
|
||||
c.(*dispatcherManager).mainDispatcher.curTs.Store(1000)
|
||||
c.(*dispatcherManager).mu.RLock()
|
||||
for _, d := range c.(*dispatcherManager).soloDispatchers {
|
||||
d.curTs.Store(1000)
|
||||
}
|
||||
c.(*dispatcherManager).mu.RUnlock()
|
||||
|
||||
c.(*dispatcherManager).tryMerge()
|
||||
assert.Equal(t, 1, c.Num())
|
||||
@ -96,6 +102,12 @@ func TestManager(t *testing.T) {
|
||||
_, err = c.Add(ctx, "mock_vchannel_2", nil, mqwrapper.SubscriptionPositionUnknown)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 3, c.Num())
|
||||
c.(*dispatcherManager).mainDispatcher.curTs.Store(1000)
|
||||
c.(*dispatcherManager).mu.RLock()
|
||||
for _, d := range c.(*dispatcherManager).soloDispatchers {
|
||||
d.curTs.Store(1000)
|
||||
}
|
||||
c.(*dispatcherManager).mu.RUnlock()
|
||||
|
||||
CheckPeriod = 10 * time.Millisecond
|
||||
go c.Run()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user