Commit Graph

893 Commits

Author SHA1 Message Date
Buqian Zheng
d506d33a8d
fix: meta cache in datanode incorrectly tracking row nums (#29817)
... of compacted segments

issue: #29816

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
2024-01-10 13:22:48 +08:00
congqixia
f18a7191f2
enhance: make ColumnBasedInsertMsgToInsertData check field missing (#29758)
fix: #29757

In previous code, `ColumnBasedInsertMsgToInsertData` adds empty field if
the insertMsg parameter does not have the column schema defined. This
may lead to unexpected behavior of caller functions.

This PR:
- Add column missing check
- Add column length check
- Generate BlobInfo for ColumnBasedInsertMsgToInsertData result

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-01-09 11:50:48 +08:00
smellthemoon
1c1f2a1371
enhance:change some logs (#29579)
related #29588

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
2024-01-05 16:12:48 +08:00
congqixia
dc6a6a50fa
enhance: reduce SyncTask AllocID call and refine code (#29701)
See also #27675

`Allocator.Alloc` and `Allocator.AllocOne` might be invoked multiple
times if there were multiple blobs set in one sync task.

This PR add pre-fetch logic for all blobs and cache logIDs in sync task
so that at most only one call of the allocator is needed.

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-01-05 10:04:46 +08:00
XuanYang-cn
a3aff37f73
fix: Correct flush buffer size metrics (#29571)
See also: #29204

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2024-01-04 17:22:46 +08:00
congqixia
79c06c5e73
fix: serializer shall bypass L0 segment merge stats step (#29636)
See also #27675
Fix logic problem introduced by #29413, which is serializer tries to
merge statslog list while level segments do not have statslog. This
shall result returning error. `writeBufferBase` ignores this error but
it shall only ignore `ErrSegmentNotFound`.

This PR add logic checking segment level before execution of merging
statslog list. And add error type check for getSyncTask failure.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-01-04 16:52:45 +08:00
congqixia
55af8f611f
fix: always sync level zero segments as flushed (#29569)
See also #27675

For now, Level zero segments shall always be synced as `Flushed` ones.
This PR fixes when level zero segments selected by policies other than
flush ts policy will be synced as growing state.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-29 10:34:47 +08:00
MrPresent-Han
ed644983e2
enhance: add param for bloomfilter(#29388) (#29490)
related: #29388

Signed-off-by: MrPresent-Han <chun.han@zilliz.com>
2023-12-28 18:10:46 +08:00
yah01
a8a0aa9357
fix: missing to support compact for Array type (#29505)
the array type can't be compacted, the system could continue with the
inserted segments, but these segments can be never compacted

fix #29503

---------

Signed-off-by: yah01 <yah2er0ne@outlook.com>
2023-12-28 15:42:48 +08:00
XuanYang-cn
632d8b3743
enhance: Change DN channelmanger into interface (#29307)
See also: #28854

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-12-27 16:00:48 +08:00
XuanYang-cn
fe04598900
enhance: Add compaction type label to metrics (#29485)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-12-27 15:56:48 +08:00
congqixia
f6cff25712
enhance: fix serialization record span & flushed buffer size metrics (#29482)
See also #27675 #29413

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-27 10:20:48 +08:00
congqixia
277849a915
enhance: separate serializer logic from sync task (#29413)
See also #27675

Since serialization segment buffer does not related to sync manager can
shall be done before submit into sync manager. So that the pk statistic
file could be more accurate and reduce complex logic inside sync
manager.

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-26 10:40:47 +08:00
congqixia
a937e4c232
fix: segment may never get flushed if sealed before watch (#29436)
See also #29092

`FlushSegments` transfer only `Growing` segment to flushing, if the
segment is in `Sealed` state before Datanode watch channel, the state
will never got satisfied for a segment be selected to be flushed.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-23 21:32:43 +08:00
SimFG
dd9c61831d
enhance: Support to get the param value in the runtime (#29297)
/kind improvement
issue: #29299

Signed-off-by: SimFG <bang.fu@zilliz.com>
2023-12-22 18:36:44 +08:00
XuanYang-cn
7a6aa8552a
fix: add back existing datanode metrics (#29360)
See also: #29204

---------

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-12-22 14:20:43 +08:00
Xiaofan
77b291c5dc
fix: Add jitter in GetSyncStaleBufferPolicy (#28626)
related to #28427
Add a jitter in syncStatleBuffer policy so all segments won't flush at
the same time

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
2023-12-20 15:00:52 +08:00
congqixia
1ee016709d
fix: Unstable TestDataSyncService/TestStartStop unit test (#29291)
fix #29290

Change EXPECT `NotifyCheckpointUpdated` call to `Maybe` expectation

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-19 23:16:42 +08:00
XuanYang-cn
5164377e68
fix: Skip updating checkpoint after dropcollection (#29220)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-12-15 16:04:45 +08:00
congqixia
4731c1b0d5
enhance: make SyncManager pool size refreshable (#29224)
See also #29223

This PR make `conc.Pool` resizable by adding `Resize` method for it. 
Also make newly added datanode `MaxParallelSyncMgrTasks` config
refreshable

---------

Signed-off-by: Congqi.Xia <congqi.xia@zilliz.com>
2023-12-15 09:58:43 +08:00
congqixia
25a4525297
enhance: Change sync manager parallel config item (#29216)
Since the sync manager is global in datanode now, the old
`maxParallelSyncTaskNum` does not fit into current implementation
anymore.

This PR add a new param item for sync mgr parallel control and enlarge
default value

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-14 20:46:41 +08:00
Bingyi Sun
ad866d2889
feat: integrate storagev2 into index build process (#28995)
issue: https://github.com/milvus-io/milvus/issues/28994

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2023-12-13 17:24:38 +08:00
wayblink
51f870da7e
feat: Introduce channelCheckpointUpdater to reduce goroutine use in ttNode (#28570)
/kind enhancement

Signed-off-by: wayblink <anyang.wang@zilliz.com>
2023-12-12 13:48:42 +08:00
congqixia
cb43647b9e
enhance: Log channel checkpoint source info in writebuffer (#28993)
See also #27675
Print channel checkpoint source with rated log will help debugging
system behavior

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-07 11:50:36 +08:00
congqixia
cb31016640
enhance: Write buffer time range when syncing logs (#28970)
Related to #27675
The timestamp from, to field is not field for new implementation of
writebuffer & sync manager
This pr fills these field for better log information

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-05 17:36:36 +08:00
Bingyi Sun
36f69ea031
feat: integrate storagev2 in building index of segcore (#28768)
issue: https://github.com/milvus-io/milvus/issues/28655

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2023-12-05 16:48:54 +08:00
yihao.dai
d26b563a8b
feat: Define import API and metadata (#28731)
Define the new rpc and metadata for ImportV2.

see also: https://github.com/milvus-io/milvus/issues/28521

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2023-12-04 19:56:35 +08:00
congqixia
393b1f943c
fix: Reject compaction task with growing segments (#28925)
See also #28924
The compaction task generated before datanode finish `SaveBinlogPath`
grpc call contains segments which are still in Growing state DataNode
shall verify each non-levelzero segments before submit compaction task
to executor

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-12-04 19:06:40 +08:00
XuanYang-cn
e62edb991a
enhance: Add FlowgraphManager interface (#28852)
- Change flowgraphManager to fgManagerImpl
- Change close to stop
- change execute to controlMemWaterLevel
- Change method name of fgManager for readability
- Add mockery for fgmanager

Issue: #28853

---------

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-30 18:42:32 +08:00
XuanYang-cn
5d0a9f9344
fix: Forget to set EntriesNum for deltalogs (#28858)
See also: #28520

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-30 16:52:31 +08:00
XuanYang-cn
aae7e62729
feat: Add levelzero compaction in DN (#28470)
See also: #27606

---------

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-30 14:30:28 +08:00
congqixia
2cd8daaf0b
fix: compacted segment still buffers delta data (#28816)
Related to #28628
Compacted segment syncing counter is not set correctly in sync task and
the bf write buffer shall not use compacted segment as candidate when
buffering delta data

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-30 10:20:28 +08:00
XuanYang-cn
321c5c32e3
fix: Separate schedule and check results loop (#28692)
This PR:

- Separates compaction scheduler and check results loop So that slow in
check-loop doesn't influence execution.

- Cleans compaction tasks when drop a vchannel so dropped-channel's
compaction tasks won't be checked over and over again.

  - Skips meta change when meta's already changed, avoid panic
  - Remove not inuse injectDone(bool) parameter

See also: #28628, #28209

---------

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-29 10:50:29 +08:00
XuanYang-cn
606ec77b66
enhance: Unify levelzero segment config in DN (#28720)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-28 18:04:26 +08:00
congqixia
eaabe0293b
fix: Update segment compactTo when compactTo segment is compacted (#28755)
Related to #28736 #28748
See also #27675
Previous PR: #28646

This PR fixes `SegmentNotFound` issue when compaction happens multiple
times and the buffer of first generation segment is sync due to stale
policy

Now the `CompactSegments` API of metacache shall update the compactTo
field of segmentInfo if the compactTo segment is also compacted to keep
the bloodline clean

Also, add the `CompactedSegment` SyncPolicy to sync the compacted
segment asap to keep metacache clean

Now the `SyncPolicy` is an interface instead of a function type so that
when it selects some segments to sync, we colud log the reason and
target segment

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-27 19:48:26 +08:00
jaime
b1e0a27f31
enhance: Add logs for each step during service initialization (#28624)
/kind improvement

Signed-off-by: jaime <yun.zhang@zilliz.com>
2023-11-27 16:30:26 +08:00
congqixia
8a9ab69369
fix: Skip statslog generation flushing empty L0 segment (#28733)
See also #27675

When L0 segment contains only delta data, merged statslog shall be
skiped when performing sync task

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-25 15:10:25 +08:00
congqixia
39be35804c
enhance: Add back clean compacted segment info logic (#28646)
See also #27675
Compacted segment info shall be removed after all buffer belongs to it
is sync-ed.
This PR add the cleanup function after triggerSyncTask logic:
- The buffer is stable and protected by mutex
- Cleanup fetches compacted & non-sync segment
- Remove segment info only there is no buffered maintained in manager

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-24 15:38:25 +08:00
smellthemoon
79c0edb1d8
enhance:Remove msgbase unnecessary assignments (#28511)
remove some unnecessary assignments, for the reason that
commonpbutil.NewMsgBase has default value.

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
2023-11-24 15:02:39 +08:00
congqixia
a2fe9dad49
enhance: Make etcd kv request timeout configurable (#28661)
See also #28660
This pr add request timeout config item for etcd kv request timeout
 Sync the default timeout value to same value for etcdKV & tikv config

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-23 19:34:23 +08:00
XuanYang-cn
b1f15fa0e8
fix: Ease the log level when sync task done (#28678)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-23 19:18:28 +08:00
Bingyi Sun
4fedff6d47
feat: integrate storage v2 into the write path (#28440)
#28378

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2023-11-23 17:26:24 +08:00
XuanYang-cn
55800ade84
fix: Remove logging extra segmentIDs (#28662)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-11-23 14:40:23 +08:00
congqixia
af18aa709b
fix: Remove not needed BlockAll call in SyncSegments (#28632)
See also #28628
Previous compaction task blocked the segment sync task and may block the
flowgraph when sync task is generated by auto sync policy This
`BlockAll` call will block forever and cause whole fg stuck

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-22 14:52:23 +08:00
smellthemoon
29249c4bd3
enhance: create goroutine only once (#28594)
create goroutine only once when getOrCreateMergedTimeTickerSender

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
2023-11-22 10:26:28 +08:00
smellthemoon
73f2bab454
enhance:add some log when create client and get component states (#28160)
/kind improvement

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
2023-11-22 09:12:22 +08:00
congqixia
2fc743992a
fix: syncmgr unstable TestCompact unittest logic (#28630)
fix #28629
orignal unit test close channel before setting the segment id, so there
is a chance that test read segment id before setting it change unit test
behavior to wait future return now

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-22 00:52:23 +08:00
congqixia
6521b519d7
enhance: Use bufSize instead of row number in sync policy (#28498)
See also #27675, comment from #27874

This PR changes the `IsFull` logic of insert buffer
Changing the limit from rowNum to buffer size,
this shall help form better binlog file when schema has variable-length
field

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-21 15:02:25 +08:00
congqixia
2b3fa8f67b
fix: Add length check for storage.NewPrimaryKeyStats (#28576)
See also #28575
Add zero-length check for `storage.NewPrimaryKeyStats`. This function
shall return error when non-positive rowNum passed.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-21 10:28:21 +08:00
congqixia
18dc6b61ce
enhance: fix LevelZero segment sync logic (#28482)
See also #27675
- Fix LevelZero segment cannot be flushed
- Add level option for syncTask
- Invoke `AddSegment` when new LevelZero segment is allocated

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2023-11-17 21:46:20 +08:00