-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support for translog fetch at the leader(remote) cluster #25
Support for translog fetch at the leader(remote) cluster #25
Conversation
7235098
to
da704a6
Compare
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
...main/kotlin/com/amazon/elasticsearch/replication/action/changes/TransportGetChangesAction.kt
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes and looks good overall.
Would be super awesome to include some tests - anything that stops us from that?
...main/kotlin/com/amazon/elasticsearch/replication/action/changes/TransportGetChangesAction.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/com/amazon/elasticsearch/replication/action/replay/TransportReplayChangesAction.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/com/amazon/elasticsearch/replication/action/replay/TransportReplayChangesAction.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
596e8f0
to
c5b2e31
Compare
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/amazon/elasticsearch/replication/integ/rest/StartReplicationIT.kt
Show resolved
Hide resolved
d5e3af4
to
ff7fde4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
var ops: List<Translog.Operation> = listOf() | ||
var fetchFromLucene = !isTranslogPruningByRetentionLeaseEnabled(shardId) | ||
try { | ||
ops = translogService.getHistoryOfOperations(indexShard, request.fromSeqNo, toSeqNo) | ||
} catch (e: ResourceNotFoundException) { | ||
fetchFromLucene = true | ||
} | ||
|
||
if(fetchFromLucene) { | ||
log.debug("Fetching changes from lucene for ${request.shardId} - from:${request.fromSeqNo}, to:$toSeqNo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial fetchFromLucene is misleading as we are fetching from translog first.
Was the intent to fetch from lucence if translog setting is absent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed offline, we make the log info for now so we can get some initial input from test runs as to how often we fall back to lucene.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ff7fde4
to
c1a050c
Compare
src/main/kotlin/com/amazon/elasticsearch/replication/seqno/RemoteClusterTranslogService.kt
Outdated
Show resolved
Hide resolved
var ops: List<Translog.Operation> = listOf() | ||
var fetchFromLucene = !isTranslogPruningByRetentionLeaseEnabled(shardId) | ||
try { | ||
ops = translogService.getHistoryOfOperations(indexShard, request.fromSeqNo, toSeqNo) | ||
} catch (e: ResourceNotFoundException) { | ||
fetchFromLucene = true | ||
} | ||
|
||
if(fetchFromLucene) { | ||
log.debug("Fetching changes from lucene for ${request.shardId} - from:${request.fromSeqNo}, to:$toSeqNo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed offline, we make the log info for now so we can get some initial input from test runs as to how often we fall back to lucene.
c1a050c
to
9b87b99
Compare
9b87b99
to
b686af5
Compare
and enable translog pruning during replication setup
b686af5
to
145ec1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Issues Resolved
N/A
Testing
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.