[PATCH] Hold a read lock during the samba_dsdb stack init() phase
jim
jim.brown at rsmas.miami.edu
Wed Apr 11 03:17:17 UTC 2018
Should these transactions be introduced after need_write is declared and
only executed if a transaction is needed?
Shouldn't they be conditional on internal state so they can otherwise be
skipped?
On 4/10/2018 9:10 PM, Andrew Bartlett via samba-technical wrote:
> --- a/python/samba/tests/dsdb_schema_attributes.py
> +++ b/python/samba/tests/dsdb_schema_attributes.py
> @@ -193,6 +193,14 @@ systemOnly: FALSE
>
> samdb2 = samba.tests.connect_samdb(self.lp.samdb_url())
>
> + # We now only update the @ATTRIBUTES when a transaction happens
> + # rather than making a read of the DB do writes.
> + #
> + # This avoids locking issues and is more expected
> +
> + samdb2.transaction_start()
> + samdb2.transaction_commit()
> +
> res = self.samdb.search(base="@ATTRIBUTES", scope=ldb.SCOPE_BASE,
> attrs=["@TEST_EXTRA"])
> self.assertEquals(len(res), 1)
> @@ -220,6 +228,14 @@ systemOnly: FALSE
>
> samdb2 = samba.tests.connect_samdb(self.lp.samdb_url())
>
> + # We now only update the @INDEXLIST when a transaction happens
> + # rather than making a read of the DB do writes.
> + #
> + # This avoids locking issues and is more expected
> +
> + samdb2.transaction_start()
> + samdb2.transaction_commit()
> +
> res = self.samdb.search(base="@INDEXLIST", scope=ldb.SCOPE_BASE,
> attrs=["@TEST_EXTRA"])
> self.assertEquals(len(res), 1)
More information about the samba-technical
mailing list