|
19 | 19 |
|
20 | 20 | package org.apache.iotdb.db.storageengine.dataregion.compaction; |
21 | 21 |
|
| 22 | +import org.apache.iotdb.commons.conf.CommonDescriptor; |
22 | 23 | import org.apache.iotdb.commons.conf.IoTDBConstant; |
23 | 24 | import org.apache.iotdb.commons.exception.IllegalPathException; |
24 | 25 | import org.apache.iotdb.commons.exception.MetadataException; |
|
31 | 32 | import org.apache.iotdb.db.exception.StorageEngineException; |
32 | 33 | import org.apache.iotdb.db.queryengine.execution.fragment.FragmentInstanceContext; |
33 | 34 | import org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TreeDeviceSchemaCacheManager; |
| 35 | +import org.apache.iotdb.db.schemaengine.lease.MetadataLeaseManager; |
34 | 36 | import org.apache.iotdb.db.storageengine.buffer.BloomFilterCache; |
35 | 37 | import org.apache.iotdb.db.storageengine.buffer.ChunkCache; |
36 | 38 | import org.apache.iotdb.db.storageengine.buffer.TimeSeriesMetadataCache; |
@@ -154,6 +156,9 @@ public class AbstractCompactionTest { |
154 | 156 | private final long oldLongestExpiredTime = |
155 | 157 | IoTDBDescriptor.getInstance().getConfig().getMaxExpiredTime(); |
156 | 158 |
|
| 159 | + private final long oldMetadataLeaseFenceMs = |
| 160 | + CommonDescriptor.getInstance().getConfig().getMetadataLeaseFenceMs(); |
| 161 | + |
157 | 162 | protected static File STORAGE_GROUP_DIR = |
158 | 163 | new File( |
159 | 164 | TestConstant.BASE_OUTPUT_PATH |
@@ -200,6 +205,8 @@ public class AbstractCompactionTest { |
200 | 205 |
|
201 | 206 | public void setUp() |
202 | 207 | throws IOException, WriteProcessException, MetadataException, InterruptedException { |
| 208 | + CommonDescriptor.getInstance().getConfig().setMetadataLeaseFenceMs(Long.MAX_VALUE); |
| 209 | + MetadataLeaseManager.getInstance().recoveryLeaseForTest(true); |
203 | 210 | fileCount = 0; |
204 | 211 | if (!SEQ_DIRS.exists()) { |
205 | 212 | Assert.assertTrue(SEQ_DIRS.mkdirs()); |
@@ -495,6 +502,8 @@ public void tearDown() throws IOException, StorageEngineException { |
495 | 502 | .getConfig() |
496 | 503 | .setInnerCompactionTaskSelectionModsFileThreshold(oldModsFileSize); |
497 | 504 | IoTDBDescriptor.getInstance().getConfig().setMaxExpiredTime(oldLongestExpiredTime); |
| 505 | + CommonDescriptor.getInstance().getConfig().setMetadataLeaseFenceMs(oldMetadataLeaseFenceMs); |
| 506 | + MetadataLeaseManager.getInstance().recoveryLeaseForTest(true); |
498 | 507 | TSFileDescriptor.getInstance().getConfig().setGroupSizeInByte(oldChunkGroupSize); |
499 | 508 |
|
500 | 509 | TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(oldPagePointMaxNumber); |
|
0 commit comments