Skip to content

Commit 6982876

Browse files
committed
add logs
1 parent d8359ff commit 6982876

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit/IoTDBRegionReconstructForIoTV1IT.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ public void normal1C3DTest() throws Exception {
128128
.build();
129129
session.open();
130130

131+
LOGGER.info(
132+
"IoTDBRegionReconstructForIoTV1IT: Node {} is to be closed",
133+
EnvFactory.getEnv().dataNodeIdToWrapper(dataNodeToBeClosed).get().getIpAndPortString());
134+
LOGGER.info(
135+
"IoTDBRegionReconstructForIoTV1IT: Node {} is to be reconstructed",
136+
EnvFactory.getEnv()
137+
.dataNodeIdToWrapper(dataNodeToBeReconstructed)
138+
.get()
139+
.getIpAndPortString());
140+
131141
// delete one DataNode's data dir, stop another DataNode
132142
File dataDirToBeReconstructed =
133143
new File(
@@ -169,15 +179,15 @@ public void normal1C3DTest() throws Exception {
169179
try {
170180
Awaitility.await()
171181
.pollInterval(1, TimeUnit.SECONDS)
172-
.atMost(1, TimeUnit.MINUTES)
182+
.atMost(10, TimeUnit.MINUTES)
173183
.until(
174184
() ->
175185
getRegionStatusWithoutRunning(session).isEmpty()
176186
&& dataDirToBeReconstructed.getAbsoluteFile().exists());
177187
} catch (Exception e) {
178188
LOGGER.error(
179189
"Two factor: {} && {}",
180-
getRegionStatusWithoutRunning(session).isEmpty(),
190+
getRegionStatusWithoutRunning(session),
181191
dataDirToBeReconstructed.getAbsoluteFile().exists());
182192
fail();
183193
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,10 @@ public void syncCloseWorkingTsFileProcessors(boolean sequence) {
19771977

19781978
private void waitClosingTsFileProcessorFinished() throws InterruptedException {
19791979
long startTime = System.currentTimeMillis();
1980+
logger.info(
1981+
"Start to wait TsFiles to close, seq files: {}, unseq files: {}",
1982+
closingSequenceTsFileProcessor,
1983+
closingUnSequenceTsFileProcessor);
19801984
while (!closingSequenceTsFileProcessor.isEmpty()
19811985
|| !closingUnSequenceTsFileProcessor.isEmpty()) {
19821986
synchronized (closeStorageGroupCondition) {
@@ -1991,6 +1995,10 @@ private void waitClosingTsFileProcessorFinished() throws InterruptedException {
19911995
"{} has spent {}s to wait for closing all TsFiles.",
19921996
databaseName + "-" + this.dataRegionId,
19931997
(System.currentTimeMillis() - startTime) / 1000);
1998+
logger.warn(
1999+
"Sseq files: {}, unseq files: {}",
2000+
closingSequenceTsFileProcessor,
2001+
closingUnSequenceTsFileProcessor);
19942002
}
19952003
}
19962004
}
@@ -2049,6 +2057,7 @@ public void forceCloseAllWorkingTsFileProcessors() throws TsFileProcessorExcepti
20492057
resource.getTsFile().getName());
20502058
}
20512059
WritingMetrics.getInstance().recordActiveTimePartitionCount(-1);
2060+
logger.info("{} files were closed", closedTsFileResources.size());
20522061
} finally {
20532062
writeUnlock();
20542063
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,4 +2334,9 @@ private void logFlushQueryReadUnlocked() {
23342334
"{}: {} release flushQueryLock", dataRegionName, tsFileResource.getTsFile().getName());
23352335
}
23362336
}
2337+
2338+
@Override
2339+
public String toString() {
2340+
return "TsFileProcessor{" + "tsFileResource=" + tsFileResource + '}';
2341+
}
23372342
}

0 commit comments

Comments
 (0)