[
https://issues.apache.org/jira/browse/IOTDB-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17404324#comment-17404324
]
Haonan Hou commented on IOTDB-1560:
-----------------------------------
I come up a way that may solve this issue. When we truncate the broken
ChunkGroup, we can write a PlanIndex at the end, which can indicate the current
position is the end of a ChunkGroup.
> Make RestorableTsFileWriter have idempotence
> --------------------------------------------
>
> Key: IOTDB-1560
> URL: https://issues.apache.org/jira/browse/IOTDB-1560
> Project: Apache IoTDB
> Issue Type: Improvement
> Components: Core/TsFile
> Reporter: Jialin Qiao
> Priority: Major
>
> When we construct a RestorableTsFileWriter on a non-complete TsFile, the
> write will truncate the broken ChunkGroup.
> However, a ChunkGroup is being seen as complete only we see the next
> ChunkGroupHeader.
> This causes when new RestorableTsFileWriter twice on a file, it will do
> truncate twice, even if the file has a complete ChunkGroup.
> We need to identify the end to a ChunkGroup and make sure the
> RestorableTsFileWriter will only truncate one time for a TsFile.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)