Skip to content

[IOTDB-5738] Retain 2 copies of snapshot#9474

Merged
OneSizeFitsQuorum merged 3 commits intoapache:masterfrom
SzyWilliam:jira5738
Mar 29, 2023
Merged

[IOTDB-5738] Retain 2 copies of snapshot#9474
OneSizeFitsQuorum merged 3 commits intoapache:masterfrom
SzyWilliam:jira5738

Conversation

@SzyWilliam
Copy link
Member

in prevention of data race

  1. delete snapshot
  2. transfer snapshot


final int retainIndex =
snapshotRetentionPolicy.getNumSnapshotsRetained() - 1; // snapshot rank starts from 0
for (int i = retainIndex; i < sortedSnapshotDirs.length - 1; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not keep the last few snapshots?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@wangchao316 wangchao316 left a comment

Choose a reason for hiding this comment

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

LGTM

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit a7fe969 into apache:master Mar 29, 2023
SzyWilliam added a commit to SzyWilliam/iotdb that referenced this pull request Mar 29, 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