docstr: target: test delete compact cross different shards
  method: 1.create with 2 shards
          2.insert entities into 2 segments
          3.delete one entity from each segment
          4.call compact and get compact plan
  expected: Generate compaction plan for each segment
docstr_tok: ["target",":","test","delete","compact","cross","different","shards","method",":","1.create","with","2","shards","2.insert","entities","into","2","segments","3.delete","one","entity","from","each","segment","4.call","compact","and","get","compact","plan","expected",":","Generate","compaction","plan","for","each","segment"]
code: def test_compact_delete_cross_shards(self):
      """
      target: test delete compact cross different shards
      method: 1.create with 2 shards
              2.insert entities into 2 segments
              3.delete one entity from each segment
              4.call compact and get compact plan
      expected: Generate compaction plan for each segment
      """
      shards_num = 2
      # insert into two segments with two shard
      collection_w = self.init_collection_wrap(
          name=cf.gen_unique_str(prefix), shards_num=shards_num
      )
      df = cf.gen_default_dataframe_data(tmp_nb)
      collection_w.insert(df)
      expr = f"{ct.default_int64_field_name} in [0, 99]"
      collection_w.delete(expr)
      assert collection_w.num_entities == tmp_nb
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      log.debug(collection_w.index())
  
      # compact
      sleep(ct.compact_retention_duration + 1)
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      collection_w.get_compaction_plans(
          check_task=CheckTasks.check_delete_compact,
          check_items={"plans_num": shards_num},
      )
  
imports: import threading
  from time import time, sleep
  import pytest
  from pymilvus.grpc_gen.common_pb2 import SegmentState
  from pymilvus.exceptions import MilvusException
  from base.client_base import TestcaseBase
  from common import common_func
  from common import common_type
  from common.common_type import CaseLabel, CheckTasks
  from utils.util_log import test_log
label_desc: Use image node_id 21 for calling the TestCompactionOperation obj's underlying member method code with example usage: obj.test_compact_delete_cross_shards() without return types