Commit 1386200b authored by VL's avatar VL Committed by Jeremy Allison

gencache: Remove transaction-based tdb

At more than one large site I've seen significant problems due to
gencache_stabilize. gencache_stabilize was mainly introduced to
survive machine crashes with the cache still being in place. Given
that most installations crash rarely and this is still a cache, this
safety is overkill and causes real problems.

With the recent changes to tdb, we should be safe enough to run on
completely corrupted databases and properly detect errors. A further
commit will introduce code that wipes the gencache.tdb if such a
corruption is detected.

There is one kind of corruption that we don't properly handle:
Orphaned space in the database. I don't have a good idea yet how to
handle this in a graceful and efficient way during normal operations,
but maybe this idea pops up at some point.
Signed-off-by: VL's avatarVolker Lendecke <>
Reviewed-by: Jeremy Allison's avatarJeremy Allison <>
parent a1e13b4a
This diff is collapsed.
......@@ -48,7 +48,6 @@ bool gencache_parse(const char *keystr,
bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
DATA_BLOB *blob,
time_t *timeout, bool *was_expired);
bool gencache_stabilize(void);
bool gencache_set_data_blob(const char *keystr, DATA_BLOB blob,
time_t timeout);
void gencache_iterate_blobs(void (*fn)(const char *key, DATA_BLOB value,
......@@ -70,8 +70,6 @@ static void terminate(struct messaging_context *msg)
/* If there was an async dns child - kill it. */
pidfile_unlink(lp_pid_directory(), "nmbd");
......@@ -237,7 +237,6 @@ static void exit_server_common(enum server_exit_reason how,
if (am_parent) {
pidfile_unlink(lp_pid_directory(), "smbd");
......@@ -266,7 +266,5 @@ bool run_local_namemap_cache1(int dummy)
return false;
return true;
......@@ -1107,8 +1107,6 @@ static struct functable net_func[] = {
DEBUG(2,("return code = %d\n", rc));
......@@ -347,24 +347,6 @@ static int net_cache_flush(struct net_context *c, int argc, const char **argv)
return 0;
static int net_cache_stabilize(struct net_context *c, int argc,
const char **argv)
if (c->display_usage) {
d_printf( "%s\n"
"net cache stabilize\n"
" %s\n",
_("Move transient cache content to stable storage"));
return 0;
if (!gencache_stabilize()) {
return -1;
return 0;
static int netsamlog_cache_for_all_cb(const char *sid_str,
time_t when_cached,
struct netr_SamInfo3 *info3,
......@@ -655,14 +637,6 @@ int net_cache(struct net_context *c, int argc, const char **argv)
N_("net cache flush\n"
" Delete all cache entries")
N_("Move transient cache content to stable storage"),
N_("net cache stabilize\n"
" Move transient cache content to stable storage")
......@@ -208,8 +208,6 @@ static void terminate(bool is_parent)
#if 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment