ldb: no need to call del_transaction in ldb_transaction_commit
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 7 Aug 2018 04:45:16 +0000 (16:45 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2018 05:08:23 +0000 (07:08 +0200)
No matter commit succeeded or failed, transation will be delete afterwards.
So there is no need to delete it here.

Aganst Samba this causes an `LDAP error 51 LDAP_BUSY` error when the transaction
fails, say while we try to add users to groups in large amount and
the original error is lost.

In Samba, the rootdse module fails early in the del part of the
start/end/del pattern, and in ldb_tdb and ldb_mdb a failed commit
always ends the transaction, even on failure.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/common/ldb.c

index 5525e70b46531b8c358740e59ad24543ddb7dddc..44a487ba9871b7ebaff83baee3534a3856f52050 100644 (file)
@@ -498,9 +498,6 @@ int ldb_transaction_commit(struct ldb_context *ldb)
                        ldb_debug(next_module->ldb, LDB_DEBUG_TRACE, "commit ldb transaction error: %s",
                                  ldb_errstring(next_module->ldb));
                }
-               /* cancel the transaction */
-               FIRST_OP(ldb, del_transaction);
-               next_module->ops->del_transaction(next_module);
        }
        return status;
 }