You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Andrzej Bialecki (Jira)" <ji...@apache.org> on 2022/02/16 15:31:00 UTC

[jira] [Comment Edited] (SOLR-16013) Overseer gives up election node before closing - inflight commands can be processed twice

    [ https://issues.apache.org/jira/browse/SOLR-16013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493279#comment-17493279 ] 

Andrzej Bialecki edited comment on SOLR-16013 at 2/16/22, 3:30 PM:
-------------------------------------------------------------------

Additionally, `OverseerElectionContext.close()` has this implementation:
{code:java}
@Override
public synchronized void close() {
  this.isClosed = true;
  overseer.close();
} {code}
So it marks itself as closed before the Overseer is closed, and I agree that it seems to me it should do it the other way around, and then simply check in `runLeaderProcess:76` if the Overseer is not closed.

Edit: I think the idea in `OverseerElectionContext` was to primarily avoid re-electing this Overseer and then wait until all its tasks are completed. But this allows other overseer to be elected and keep processing the in-flight tasks as new.


was (Author: ab):
Additionally, `OverseerElectionContext.close()` has this implementation:
{code:java}
@Override
public synchronized void close() {
  this.isClosed = true;
  overseer.close();
} {code}
So it marks itself as closed before the Overseer is closed, and I agree that it seems to me it should do it the other way around, and then simply check in `runLeaderProcess:76` if the Overseer is not closed.

> Overseer gives up election node before closing - inflight commands can be processed twice
> -----------------------------------------------------------------------------------------
>
>                 Key: SOLR-16013
>                 URL: https://issues.apache.org/jira/browse/SOLR-16013
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Priority: Major
>
> {{ZkController}} shutdown currently has these two lines (in this order)...
> {code:java}
>     customThreadPool.submit(() -> IOUtils.closeQuietly(overseerElector.getContext()));
>     customThreadPool.submit(() -> IOUtils.closeQuietly(overseer));
> {code}
> AFAICT this means that means that the overseer nodeX will give up it's election node (via overseerElector) allowing some other nodeY to be elected a new overseer, **BEFORE** Overseer nodeX shuts down it's {{Overseer}} object, which waits for the {{OverseerThread}} to finish processing any tasks in process.
> In practice, this seems to make it possible for a single command in the overseer queue to get processed twice.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org