Skip to content

[IOTDB-5286]Fix target files should not be select to participate in other compaction task#8615

Merged
THUMarkLau merged 5 commits intoapache:masterfrom
choubenson:fixCompactionSchedule
Jan 1, 2023
Merged

[IOTDB-5286]Fix target files should not be select to participate in other compaction task#8615
THUMarkLau merged 5 commits intoapache:masterfrom
choubenson:fixCompactionSchedule

Conversation

@choubenson
Copy link
Contributor

@choubenson choubenson commented Dec 26, 2022

Description
When the system is restarted, a compaction error is reported: the source file is deleted and the target file is also deleted, which will set allowCompaction to false.

Reason
Target files are selected to participate in other compaction tasks before the end of the current task, causing unexpected errors.

Solution
Set target file to COMPACTING until the end of task, so that it can be selected to participate in other task after this task finishes.


/** Used for compaction to create target files. */
public TsFileResource(File file, TsFileResourceStatus status) {
this.file = file;
Copy link
Contributor

Choose a reason for hiding this comment

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

using this(file) to reduce duplicated codes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

@THUMarkLau THUMarkLau merged commit 8c495e3 into apache:master Jan 1, 2023
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.

3 participants