Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix visible metadata, version, work processor bugs when recovering #966

Merged
merged 13 commits into from Apr 1, 2020

Conversation

qiaojialin
Copy link
Member

Fix many bugs when recovering:

(1) when recovering the last unclosed SEQ file, the TsFileProcessor is added to workUnsequenceTsFileProcessors.
(2) when recovering the last unclosed UNSEQ file, the TsFileProcessor isn's added to any workTsFileProcessors.
(3) when recovering, the metadata get from TsFile is set to chunkMetadataListMap, however, visibale metadata is recovered from chunkGroupInfoList. Therefore, the persisted Chunk is not visible.
(4) when recovering, the TsFileRecoverPerformer needs to receive a partitionId. However, before recovering, the startTime & endTime maps are empty. So the partitionId is -1, which leads to the wrong version of Deletion and memtable version in recovery. I get the partitionId from resource path. No more -1 partitions in the future.

Copy link
Contributor

@SilverNarcissus SilverNarcissus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Only one issue, please have a check.

return StorageEngine.getTimePartition(startTimeMap.values().iterator().next());
}
String[] splits = FilePathUtils.splitTsFilePath(this);
return Long.parseLong(splits[splits.length - 2]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we sync a tsfile from other iotdb, will this tsfile has time partition directory? Maybe we should use startTimeMap to get time partition

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I use the startTimeMap first, then the path

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not guaranteed that the other IoTDB will use the same partition interval, so it is better to check the whole startTimeMap and endTimeMap to see if any device has crossed a partition and report an exception if so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restart and load could use different getPartition method, one check partition and the other not. I will add a method with partition check

Copy link
Contributor

@liutaohua liutaohua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@qiaojialin qiaojialin merged commit c6c23a3 into master Apr 1, 2020
@qiaojialin qiaojialin deleted the fix_many_bugs branch April 1, 2020 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants