jixuan1989 commented on a change in pull request #2184:
URL: https://github.com/apache/iotdb/pull/2184#discussion_r559897055
##########
File path: server/src/main/java/org/apache/iotdb/db/utils/UpgradeUtils.java
##########
@@ -66,9 +73,9 @@ public static boolean isNeedUpgrade(TsFileResource
tsFileResource) {
} finally {
tsFileResource.readUnlock();
}
- try (TsFileSequenceReader tsFileSequenceReader = new TsFileSequenceReader(
+ try (TsFileSequenceReaderForV2 tsFileSequenceReader = new
TsFileSequenceReaderForV2(
tsFileResource.getTsFile().getAbsolutePath())) {
- if
(tsFileSequenceReader.readVersionNumber().equals(TSFileConfig.VERSION_NUMBER_V1))
{
+ if
(tsFileSequenceReader.readVersionNumberV2().equals(TSFileConfig.VERSION_NUMBER_V2))
{
Review comment:
where to check if the user uses Version 1 (i.e., version <0.10), then
reject the upgrade.
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -515,6 +480,11 @@ else if (upgradeFolder.exists()) {
Collections.addAll(tsFiles,
fsFactory.listFilesBySuffix(partitionFolder.getAbsolutePath(),
TSFILE_SUFFIX));
}
+ else {
+ // move
Review comment:
"move" ?
##########
File path: server/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java
##########
@@ -75,38 +75,33 @@ public static void main(String[] args) throws IOException {
String.format("%20d",
TSFileConfig.MAGIC_STRING.getBytes().length)
+ "|\t[version number] "
+ reader.readVersionNumber());
+ long nextChunkGroupHeaderPos = (long)
TSFileConfig.MAGIC_STRING.getBytes().length
Review comment:
how about other TsFileTools
##########
File path:
session/src/test/java/org/apache/iotdb/session/IoTDBSessionIteratorIT.java
##########
@@ -295,7 +295,7 @@ private void prepareData() throws IoTDBConnectionException,
StatementExecutionEx
List<TSDataType> types = new ArrayList<>();
for (int i = 1; i <= 6; i++) {
measurements.add("s" + i);
- types.add(TSDataType.deserialize((short) (i - 1)));
+ types.add(TSDataType.deserialize((byte) (i - 1)));
Review comment:
check Python and Go....
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -1717,23 +1692,19 @@ private void
upgradeTsFileResourceCallBack(TsFileResource tsFileResource) {
resource.getEndTime(device))
);
}
- insertLock.writeLock().lock();
- tsFileManagement.writeLock();
- try {
- if (tsFileResource.isSeq()) {
- tsFileManagement.addAll(upgradedResources, true);
- upgradeSeqFileList.remove(tsFileResource);
- } else {
- tsFileManagement.addAll(upgradedResources, false);
- upgradeUnseqFileList.remove(tsFileResource);
+ upgradeFileCount.getAndAdd(-1);
+ // load all upgraded resources in this sg to tsFileManagement
+ if (upgradeFileCount.get() == 0) {
Review comment:
any side-effect that only moving finished files from upgrade list to the
normal fileList after all files are upgraded?
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -1748,10 +1719,38 @@ private void
upgradeTsFileResourceCallBack(TsFileResource tsFileResource) {
}
}
}
- if (StorageEngine.getInstance().countUpgradeFiles() == 0) {
Review comment:
So, when to stop the service?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]