During replication cycles the client and server exchange highwatermark objects, one member of which is reserved_usn, which the Samba server uses as a sort of auxiliary cookie to ensure each highwatermark is unique. It expects the client (normally another DC) to use a request highwatermark with the reserved_usn unchanged. Unfortunately what Entra ID Connect does is set reserved_usn to zero, which Samba sometimes interprets as a request to start again from the beginning, causing an eternal loop. It used to be much easier to get into this loop, prior to the fixes for fixes for https://bugzilla.samba.org/show_bug.cgi?id=15401 (in particular 79ca6ef2). In https://gitlab.com/samba-team/samba/-/merge_requests/3757 we have patches that cover off the final case where there are a lot of links and other parts of the highwatermark might not change. Effectively the logic is changed to accept (reserved_usn == the_expected_value || reserved_usn == 0). This bug is to facilitate backport.
This bug was referenced in samba master: 4b4a7c3fd465267c43d9586ab79ca8f84c0cad24 796e92a530004406dcb3fea33f54833c722480a0 67c7609ab755291de27c620120a1c71b557452e4 2e1ccb35239fc6fe129c943bb7305bd4612d72d7 5ef27019033fd73decd111f9426e7f8982cbb806 7a623d8d5626b4e6c88ffb85e36f0934d89ed830 44a478038b6ec78aaec832d9dbde7fa6b2cdd639 7dac035896b368bf3a86acf58260eef39d195d19
Created attachment 18512 [details] patch for 4.21
Comment on attachment 18512 [details] patch for 4.21 Looks good, I didn't get to see this when it went for first review into master, but I really like both the code fix and the testing approach.
Assigning to Jule for 4.21
Pushed to autobuild-v4-21-test.
This bug was referenced in samba v4-21-test: 9b7f1ce151ba24804f337d24de71965c6b8eccc7 ec6263a3f0e5cd1c50f460aea9a85562d6e9e500 b43b7a9ac1bc2a75064c0261b81fc18275bfd482 9954fd8994ff72c4c3f0dd7bb8b8aab93c1e23e7 6c66d01c6df1010a85ea96e5d7a41cc4965b581b 28626e763eef4642d02024d0d28b2235a2cba826 5842ec1d0565f62b28c66534606823731c73d33e 884500cb316c80c9a530756e6aa73ff77b8973a3
Closing out bug report. Thanks!
This bug was referenced in samba v4-21-stable (Release samba-4.21.3): 9b7f1ce151ba24804f337d24de71965c6b8eccc7 ec6263a3f0e5cd1c50f460aea9a85562d6e9e500 b43b7a9ac1bc2a75064c0261b81fc18275bfd482 9954fd8994ff72c4c3f0dd7bb8b8aab93c1e23e7 6c66d01c6df1010a85ea96e5d7a41cc4965b581b 28626e763eef4642d02024d0d28b2235a2cba826 5842ec1d0565f62b28c66534606823731c73d33e 884500cb316c80c9a530756e6aa73ff77b8973a3