diff options
author | Michael Adam <obnox@samba.org> | 2014-07-02 07:44:04 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2014-11-26 16:43:04 +0100 |
commit | 35fd2ca4984b3a1a8bbcb5c1c9e0d724e3c63d80 (patch) | |
tree | fa4bee6b9a420e96f75f8b248b9b432edae354a1 /source3/script/tests | |
parent | d240cf7894f076a2ed2b6bc434f20a93cfbb1ca4 (diff) | |
download | samba-35fd2ca4984b3a1a8bbcb5c1c9e0d724e3c63d80.tar.gz samba-35fd2ca4984b3a1a8bbcb5c1c9e0d724e3c63d80.tar.xz samba-35fd2ca4984b3a1a8bbcb5c1c9e0d724e3c63d80.zip |
s3:gencache: don't use transaction non non-persistent gencache_notrans.tdb
gencache_notrans.tdb is a non-persistent cache layer above the
persistent gencache.tdb. Despite its name, and despite the
nature of non-persistent tdbs, the current stabilization code
uses a transaction on gencache_notrans.tdb like this:
transaction_start(cache)
transaction_start(cache_notrans)
traverse(cache_notrans, stabilize_fn)
transaction_commit(cache)
transaction_commit(cache_notrans)
where stabilze_fn does this on a record:
1. store it to or delete it from cache
(depending on the timeout)
2. delete it from the cache_notrans
This patch changes gencache_notrans.tdb to avoid
transactions by using an all-record lock like this:
tdb_allrecord_lock(cache_notrans)
transaction_start(cache)
traverse(cache_notrans, stabilize_fn_mod)
transaction_commit(cache)
traverse(cache_notrans, wipe_fn)
tdb_wipe_all(cache_notrans)
tdb_allrecord_unlock(cache_notrans)
with stabilize_fn_mod doing only:
1. store the record to or delete it from cache
(depending on the timeout)
and wipe_fn deleting the records from the gencache_notrans db.
This is a step towards making non-persistent-db specific features
like mutex locking usable for gencache_notrans.tdb.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'source3/script/tests')
0 files changed, 0 insertions, 0 deletions