Skip to content

Commit 8b10eac

Browse files
committed
Merge branch 'dev/1.3' of https://github.com/apache/iotdb into multi-fix
2 parents c2ee6bf + 23ce17a commit 8b10eac

5 files changed

Lines changed: 52 additions & 12 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.iotdb.confignode.it;
21+
22+
import org.apache.iotdb.consensus.ConsensusFactory;
23+
import org.apache.iotdb.it.env.EnvFactory;
24+
import org.apache.iotdb.it.framework.IoTDBTestRunner;
25+
import org.apache.iotdb.itbase.category.ClusterIT;
26+
27+
import org.junit.Before;
28+
import org.junit.experimental.categories.Category;
29+
import org.junit.runner.RunWith;
30+
31+
@RunWith(IoTDBTestRunner.class)
32+
@Category({ClusterIT.class})
33+
public class IoTDBConfigNodeSnapshot2IT extends IoTDBConfigNodeSnapshotIT {
34+
@Before
35+
public void setUp() throws Exception {
36+
// set setConfigNodeRatisSnapshotTriggerThreshold to 1
37+
EnvFactory.getEnv()
38+
.getConfig()
39+
.getCommonConfig()
40+
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
41+
.setConfigNodeRatisSnapshotTriggerThreshold(1)
42+
.setTimePartitionInterval(testTimePartitionInterval);
43+
44+
// Init 2C2D cluster environment
45+
EnvFactory.getEnv().initClusterEnvironment(2, 2);
46+
}
47+
}

integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,15 @@
7878
@RunWith(IoTDBTestRunner.class)
7979
@Category({ClusterIT.class})
8080
public class IoTDBConfigNodeSnapshotIT {
81-
private static final int testRatisSnapshotTriggerThreshold = 100;
82-
private static final long testTimePartitionInterval = 86400;
81+
protected final long testTimePartitionInterval = 86400;
8382

8483
@Before
8584
public void setUp() throws Exception {
8685
EnvFactory.getEnv()
8786
.getConfig()
8887
.getCommonConfig()
8988
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
90-
.setConfigNodeRatisSnapshotTriggerThreshold(testRatisSnapshotTriggerThreshold)
89+
.setConfigNodeRatisSnapshotTriggerThreshold(100)
9190
.setTimePartitionInterval(testTimePartitionInterval);
9291

9392
// Init 2C2D cluster environment

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TriggerInfo.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws TException, IOExcept
247247
return false;
248248
}
249249

250-
acquireTriggerTableLock();
251250
try (FileOutputStream fileOutputStream = new FileOutputStream(snapshotFile)) {
252251

253252
serializeExistedJarToMD5(fileOutputStream);
@@ -257,8 +256,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws TException, IOExcept
257256
// fsync
258257
fileOutputStream.getFD().sync();
259258
return true;
260-
} finally {
261-
releaseTriggerTableLock();
262259
}
263260
}
264261

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/UDFInfo.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws IOException {
194194
return false;
195195
}
196196

197-
acquireUDFTableLock();
198197
try (FileOutputStream fileOutputStream = new FileOutputStream(snapshotFile)) {
199198

200199
serializeExistedJarToMD5(fileOutputStream);
@@ -205,8 +204,6 @@ public boolean processTakeSnapshot(File snapshotDir) throws IOException {
205204
fileOutputStream.getFD().sync();
206205

207206
return true;
208-
} finally {
209-
releaseUDFTableLock();
210207
}
211208
}
212209

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceExecution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,6 @@ private void initialize(IDriverScheduler scheduler, boolean isExplainAnalyze) {
306306

307307
clearShuffleSinkHandle(newState);
308308

309-
// delete tmp file if exists
310-
deleteTmpFile();
311-
312309
// close the driver after sink is aborted or closed because in driver.close() it
313310
// will try to call ISink.setNoMoreTsBlocks()
314311
for (IDriver driver : drivers) {
@@ -320,6 +317,9 @@ private void initialize(IDriverScheduler scheduler, boolean isExplainAnalyze) {
320317
// release file handlers
321318
context.releaseResourceWhenAllDriversAreClosed();
322319

320+
// delete tmp file if exists
321+
deleteTmpFile();
322+
323323
// release memory
324324
exchangeManager.deRegisterFragmentInstanceFromMemoryPool(
325325
instanceId.getQueryId().getId(), instanceId.getFragmentInstanceId(), true);

0 commit comments

Comments
 (0)