From ee94788e63d9f35daca7c0d1e80a488f738a9c52 Mon Sep 17 00:00:00 2001 From: Thierry Bordaz Date: Sep 01 2023 09:02:08 +0000 Subject: BZ 2124214 - schema compat plugin deadlock on delete post op Bug description: backends locks (SC map and retroCL) are acquired in the opposite order (https://bugzilla.redhat.com/show_bug.cgi?id=2124214#c17) Fix description: Credits of the fix are to Pierre Rogier who found a reproducible testcase, did the fix and verified it. In specific condition of retroCL trimming the DEL callback of the SC should check if the backend should be ignored relates: 2124214 --- diff --git a/src/back-shr.c b/src/back-shr.c index ce2b1f3..1792bef 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -2811,6 +2811,18 @@ backend_shr_delete_cb(Slapi_PBlock *pb) if (wrap_get_call_level() > 0) { return 0; } + /* especially important to test if we want to prevent frequent + * deadlocks when backends are accesses in opposite order. + * i.e. "regular" update on domain map+retroCL and retroCL trimming + * retroCL+domain map + */ + if (backend_shr_write_ignore(pb)) { +#if DEBUG_MAP_LOCK + slapi_log_error(SLAPI_LOG_FATAL, "schema-compat", + "backend_shr_delete_cb: (%p) operation is not impacting schema compat\n", PR_MyThreadId(), 1); +#endif + return 0; + } /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state);