void executeMergeConfigTask(List<ConfigInfoChanged> configInfoList, int pageSize) {
        for (ConfigInfoChanged configInfo : configInfoList) {
            String dataId = configInfo.getDataId();
            String group = configInfo.getGroup();
            String tenant = configInfo.getTenant();
            try {
                List<ConfigInfoAggr> datumList = new ArrayList<>();
                int rowCount = configInfoAggrPersistService.aggrConfigInfoCount(dataId, group, tenant);
                int pageCount = (int) Math.ceil(rowCount * 1.0 / pageSize);
                for (int pageNo = 1; pageNo <= pageCount; pageNo++) {
                    Page<ConfigInfoAggr> page = configInfoAggrPersistService.findConfigInfoAggrByPage(dataId, group,
                            tenant, pageNo, pageSize);
                    if (page != null) {
                        datumList.addAll(page.getPageItems());
                        LOGGER.info("[merge-query] {}, {}, size/total={}/{}", dataId, group, datumList.size(),
                                rowCount);
                    }
                }
                
                // merge
                if (datumList.size() > 0) {
                    ConfigInfo cf = MergeTaskProcessor.merge(dataId, group, tenant, datumList);
                    String aggrContent = cf.getContent();
                    String localContentMD5 = ConfigCacheService.getContentMd5(GroupKey.getKey(dataId, group));
                    String aggrConetentMD5 = MD5Utils.md5Hex(aggrContent, Constants.ENCODE);
                    
                    if (!StringUtils.equals(localContentMD5, aggrConetentMD5)) {
                        configInfoPersistService.insertOrUpdate(null, null, cf, null);
                        LOGGER.info("[merge-ok] {}, {}, size={}, length={}, md5={}, content={}", dataId, group,
                                datumList.size(), cf.getContent().length(), cf.getMd5(),
                                ContentUtils.truncateContent(cf.getContent()));
                    }
                } else {
                    // remove config info
                    configInfoPersistService.removeConfigInfo(dataId, group, tenant, InetUtils.getSelfIP(), null);
                    LOGGER.warn("[merge-delete] delete config info because no datum. dataId=" + dataId + ", groupId="
                            + group);
                }
                
            } catch (Throwable e) {
                LOGGER.info("[merge-error] " + dataId + ", " + group + ", " + e.toString(), e);
            }
            FINISHED.incrementAndGet();
            if (FINISHED.get() % 100 == 0) {
                LOGGER.info("[all-merge-dump] {} / {}", FINISHED.get(), total);
            }
        }
        LOGGER.info("[all-merge-dump] {} / {}", FINISHED.get(), total);
    }
@Test
    void executeMergeConfigTask() {
        envUtilMockedStatic.when(() -> EnvUtil.getProperty(eq("nacos.config.retention.days"))).thenReturn("10");
        ConfigInfoChanged hasDatum = new ConfigInfoChanged();
        hasDatum.setDataId("hasDatumdataId1");
        hasDatum.setTenant("tenant1");
        hasDatum.setGroup("group1");
        ConfigInfoChanged noDatum = new ConfigInfoChanged();
        noDatum.setDataId("dataId1");
        noDatum.setTenant("tenant1");
        noDatum.setGroup("group1");
        List<ConfigInfoChanged> configInfoList = new ArrayList<>();
        configInfoList.add(hasDatum);
        configInfoList.add(noDatum);
        
        when(configInfoAggrPersistService.aggrConfigInfoCount(eq(hasDatum.getDataId()), eq(hasDatum.getGroup()),
                eq(hasDatum.getTenant()))).thenReturn(2);
        Page<ConfigInfoAggr> datumPage = new Page<>();
        ConfigInfoAggr configInfoAggr1 = new ConfigInfoAggr();
        configInfoAggr1.setContent("12344");
        ConfigInfoAggr configInfoAggr2 = new ConfigInfoAggr();
        configInfoAggr2.setContent("12345666");
        datumPage.getPageItems().add(configInfoAggr1);
        datumPage.getPageItems().add(configInfoAggr2);
        
        when(configInfoAggrPersistService.findConfigInfoAggrByPage(eq(hasDatum.getDataId()), eq(hasDatum.getGroup()),
                eq(hasDatum.getTenant()), anyInt(), anyInt())).thenReturn(datumPage);
        
        when(configInfoAggrPersistService.aggrConfigInfoCount(eq(noDatum.getDataId()), eq(noDatum.getGroup()),
                eq(noDatum.getTenant()))).thenReturn(0);
        
        mergeDatumService.executeMergeConfigTask(configInfoList, 1000);
    }