metadata.tdb was not being locked alongside all the other databases during lock_read in the partitions module, which causes a lock ordering issue later during transaction commit if another process reads the schema sequence number.
This wasn't the issue.
This actually was a real issue, we need to lock metadata.tdb at the start of every read_lock and write transaction, and close it last.
Created attachment 15319 [details] lock ordering 4.11 backport 4.11 backport, no changes from master merge request, tested on 4.11.0rc1
Created attachment 15334 [details] lock ordering 4.11 backport V2 Last backport didn't use -x on cherry-pick and was cherry-picked from my branch instead of master. This one is correct.
Created attachment 15335 [details] lock ordering 4.11 backport V3 Correct file...
Comment on attachment 15335 [details] lock ordering 4.11 backport V3 Note that there's still a double semi-colon, which Coverity doesn't like. I don't think it matters here though.
G'Day Karolin, Please select for Samba 4.11.0rcNEXT, this fixes an important race for us in CI (but is not important for end users, so no release note required).
Pushed to v4-11-test. Closing out bug report. Thanks!