Bug 7579 - ctdb_vacuum specifies two different paths to tuning database
ctdb_vacuum specifies two different paths to tuning database
Status: RESOLVED FIXED
Product: CTDB 2.5.x or older
Classification: Unclassified
Component: ctdb
unspecified
Other All
: P3 normal
: ---
Assigned To: Michael Adam
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-21 11:10 UTC by Jeff Butler
Modified: 2016-08-13 09:58 UTC (History)
1 user (show)

See Also:


Attachments
Suggested fix for issue. (636 bytes, patch)
2010-07-21 11:18 UTC, Jeff Butler
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Butler 2010-07-21 11:10:09 UTC
We've specified different directories for dbdir and dbdir-state.  As a result, changes in the vacuum interval are not being respected.  vacuuming only takes place at the default interval, not at the newly calculated intervals.  This is because two different paths are specified to the tuning database.  In get_vacuum_interval():

        vac_dbname = talloc_asprintf(tmp_ctx, "%s/%s.%u", ctdb->db_directory, TUNINGDBNAME\
, ctdb->pnn);

In update_tuning_db():

	vac_dbname = talloc_asprintf(tmp_ctx, "%s/%s.%u",
                                     ctdb_db->ctdb->db_directory_state,
                                     TUNINGDBNAME, ctdb_db->ctdb->pnn);

To fix this I think we just need to change get_vacuum_interval() to use the state directory rather than the db directory (or at least make the two consistent and use the dbdir for both).

If you are running with dbdir == state dir, then you won't see this problem.  I've made the change and I'm not seeing the interval vary based on the number of entries that the vacuum picks up.
Comment 1 Jeff Butler 2010-07-21 11:18:05 UTC
Created attachment 5857 [details]
Suggested fix for issue.

Change get_vacuum_interval to use the state directory rather than the db directory.
Comment 2 Martin Schwenke 2016-08-13 09:58:00 UTC
The code mentioned was removed back in 2011:

commit d93750ea3f5cb854e5893e53795fd08656e7c12c
Author: Michael Adam <obnox@samba.org>
Date:   Tue Dec 13 14:06:09 2011 +0100

    vacuum: remove update_tuning_db()

commit 621c3ce957cb946ca05a2d527c037746ae2f01d3
Author: Michael Adam <obnox@samba.org>
Date:   Tue Dec 13 14:16:23 2011 +0100

    vacuum: change get_vacuum_interval() to simply return the VacuumDefaultInterval tunable

It was a valid bug, so just marking this fixed...  although differently to what the submitter recommended...  ;-)