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

[Remote Store] Support refresh level durability #5251

Closed
Tracked by #5671
sachinpkale opened this issue Nov 15, 2022 · 2 comments
Closed
Tracked by #5671

[Remote Store] Support refresh level durability #5251

sachinpkale opened this issue Nov 15, 2022 · 2 comments
Labels
distributed framework enhancement Enhancement or improvement to existing feature or request Storage:Durability Issues and PRs related to the durability framework

Comments

@sachinpkale
Copy link
Member

Is your feature request related to a problem? Please describe.

  • As part of remote store feature that was introduced in OpenSearch 2.3, segments are uploaded to remote store post each refresh.
  • This means remote segment store contains segments that were part of last refresh.
  • But the _remotestore/_restore API only supports commit level durability.
  • This feature will add refresh level durability support to the restore API.
@sachinpkale sachinpkale added enhancement Enhancement or improvement to existing feature or request untriaged labels Nov 15, 2022
@sachinpkale
Copy link
Member Author

Currently, I am thinking of using the same flow that segment replication uses when replica receives the publish checkpoint.

public void commitSegmentInfos(SegmentInfos latestSegmentInfos, long maxSeqNo, long processedCheckpoint) throws IOException {
assert indexSettings.isSegRepEnabled();
metadataLock.writeLock().lock();
try {
final Map<String, String> userData = new HashMap<>(latestSegmentInfos.getUserData());
userData.put(LOCAL_CHECKPOINT_KEY, String.valueOf(processedCheckpoint));
userData.put(SequenceNumbers.MAX_SEQ_NO, Long.toString(maxSeqNo));
latestSegmentInfos.setUserData(userData, true);
latestSegmentInfos.commit(directory());
directory.sync(latestSegmentInfos.files(true));
directory.syncMetaData();
cleanupAndPreserveLatestCommitPoint("After commit", latestSegmentInfos);
} finally {
metadataLock.writeLock().unlock();
}
}

@mch2
Copy link
Member

mch2 commented Dec 1, 2022

@sachinpkale Why do we need to support refresh level durability with node-node replication? Could remote store use commit level durability until we implement remote store as the source of replication for segrep? There is a lot of overlap here with that effort.

My concern here is that remote store now is coupled to segrep's node-node implementation, and this will add further network load on primaries that have to copy to remote store & all replicas. I think this is ok to do if we are using it as the first half of using remote store as a src of replication, but doesn't make much sense with node-node.

note also on the commitSegmentInfos method you linked above - We can skip this commit on replicas entirely if those files are already in remote store & we can recover from it.

Edit -Added more context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed framework enhancement Enhancement or improvement to existing feature or request Storage:Durability Issues and PRs related to the durability framework
Projects
None yet
Development

No branches or pull requests

3 participants