Non-blocking primary relocation hand-off#19013
Conversation
a964b78 to
4ae3d5f
Compare
| try { | ||
| if (primaryShardReference.isRelocated()) { | ||
|
|
||
| Callback<Throwable> onFailure = t -> { |
There was a problem hiding this comment.
all these small call backs make me think we need AsyncPrimaryAction which has the channel and the task as fields and implements ActionListener<PrimaryShardReference> so we can pass it as a value to the call backs?
There was a problem hiding this comment.
I would very much prefer an AsyncPrimaryAction (especially so that it implements AbstractRunnable, making failures simpler).
|
Thx @ywelsch . I left some comments that I think will simplify things. My main concern here is the extra IndexShardOperationsLock wrapper around |
|
@bleskes I've updated the PR with the following main changes:
|
| @@ -157,7 +160,7 @@ protected void resolveRequest(MetaData metaData, IndexMetaData indexMetaData, Re | |||
|
|
|||
| /** | |||
| * Synchronous replica operation on nodes with replica copies. This is done under the lock form | |||
Primary relocation and indexing concurrently can currently lead to a deadlock situation as indexing operations are blocked on a (bounded) thread pool during the hand-off phase between old and new primary. This PR replaces blocking of indexing operations by putting operations that cannot be executed during relocation hand-off in a queue to be executed once relocation completes.
Relates to #18553, #15900.