You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "horizonzy (via GitHub)" <gi...@apache.org> on 2023/03/15 15:14:27 UTC
[GitHub] [bookkeeper] horizonzy commented on pull request #3818: [improvement] Delay all audit task when have a already delayed bookie check task
horizonzy commented on PR #3818:
URL: https://github.com/apache/bookkeeper/pull/3818#issuecomment-1470187804
> > LGTM. The feature works when there is only one bookie shutdown, if there are two bookies or more shutdown at the same, the feature won't work. Maybe we can add a test for two bookies shutdown cases.
>
> @horizonzy @hangc0276 Auditor has a single-threaded thread pool, and the auditBookie task triggered by the listening event and the detection task triggered by the timing task are executed strictly serially.
>
> Therefore, a single bookie failure will delayed auditBookie tasks. At this point, other detection tasks may continue to execute. This PR can avoid this situation. But when lostBookieRecoveryDelay=0 or more than 2 bookies fail, the executor will only be used to process auditBookie, unable to perform other detection tasks.
>
> So we don't need to worry about more than 2 bookie failure scenarios, because this is determined by SingleThreadScheduledExecutor.
>
> ```java
> executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
> @Override
> public Thread newThread(Runnable r) {
> Thread t = new Thread(r, "AuditorBookie-" + bookieIdentifier);
> t.setDaemon(true);
> return t;
> }
> });
> ```
Ok, that's fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org