fix: remove isFull check in compaction.enqueue (#34338)

#30633

Signed-off-by: wayblink <anyang.wang@zilliz.com>
This commit is contained in:
wayblink 2024-07-03 18:10:10 +08:00 committed by GitHub
parent 2e434e4453
commit a501fa11c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View File

@ -534,9 +534,6 @@ func (c *compactionPlanHandler) getCompactionTask(planID int64) CompactionTask {
func (c *compactionPlanHandler) enqueueCompaction(task *datapb.CompactionTask) error {
log := log.With(zap.Int64("planID", task.GetPlanID()), zap.Int64("triggerID", task.GetTriggerID()), zap.Int64("collectionID", task.GetCollectionID()), zap.String("type", task.GetType().String()))
if c.isFull() {
return errCompactionBusy
}
t, err := c.createCompactTask(task)
if err != nil {
return err

View File

@ -528,7 +528,7 @@ func (s *CompactionPlanHandlerSuite) TestGetCompactionTask() {
func (s *CompactionPlanHandlerSuite) TestExecCompactionPlan() {
s.SetupTest()
s.mockMeta.EXPECT().CheckAndSetSegmentsCompacting(mock.Anything).Return(true, true).Once()
s.mockMeta.EXPECT().CheckAndSetSegmentsCompacting(mock.Anything).Return(true, true).Maybe()
s.mockMeta.EXPECT().SaveCompactionTask(mock.Anything).Return(nil)
handler := newCompactionPlanHandler(nil, s.mockSessMgr, s.mockCm, s.mockMeta, s.mockAlloc, nil, nil)
@ -545,7 +545,7 @@ func (s *CompactionPlanHandlerSuite) TestExecCompactionPlan() {
s.handler.taskNumber.Add(1000)
task.PlanID = 2
err = s.handler.enqueueCompaction(task)
s.Error(err)
s.NoError(err)
}
func (s *CompactionPlanHandlerSuite) TestCheckCompaction() {