[tracker] libtracker-data: Make writable/wal interfaces unique
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Make writable/wal interfaces unique
- Date: Mon, 10 Jul 2017 00:14:04 +0000 (UTC)
commit 24489b72aca70748be7d5eeea7bd33889658af8d
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jul 9 21:26:26 2017 +0200
libtracker-data: Make writable/wal interfaces unique
Instead of "picking" one of the several DB interfaces created,
ensure canonical ones for these operations.
src/libtracker-data/libtracker-data.vapi | 2 +
src/libtracker-data/tracker-data-manager.c | 18 +++++++++--
src/libtracker-data/tracker-data-manager.h | 2 +
src/libtracker-data/tracker-data-query.c | 2 +-
src/libtracker-data/tracker-data-update.c | 38 +++++++++++-----------
src/libtracker-data/tracker-db-manager.c | 43 +++++++++++++++++++++++-
src/libtracker-data/tracker-db-manager.h | 3 ++
src/libtracker-data/tracker-sparql-query.vala | 16 +++++----
src/libtracker-direct/tracker-direct.vala | 9 +++--
src/tracker-store/tracker-resources.vala | 2 +-
src/tracker-store/tracker-store.vala | 15 ++++-----
11 files changed, 106 insertions(+), 44 deletions(-)
---
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi
index 7244ef3..294b735 100644
--- a/src/libtracker-data/libtracker-data.vapi
+++ b/src/libtracker-data/libtracker-data.vapi
@@ -237,6 +237,8 @@ namespace Tracker {
public Manager (DBManagerFlags flags, GLib.File cache_location, GLib.File data_location,
GLib.File ontology_location, bool journal_check, bool restoring_backup, uint select_cache_size, uint
update_cache_size);
public unowned Ontologies get_ontologies ();
public unowned DBInterface get_db_interface ();
+ public unowned DBInterface get_writable_db_interface ();
+ public unowned DBInterface get_wal_db_interface ();
public unowned Data.Update get_data ();
public void shutdown ();
}
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index e7881a2..d38b90a 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -579,7 +579,7 @@ fix_indexed (TrackerDataManager *manager,
const gchar *service_name;
const gchar *field_name;
- iface = tracker_db_manager_get_db_interface (manager->db_manager);
+ iface = tracker_db_manager_get_writable_db_interface (manager->db_manager);
class = tracker_property_get_domain (property);
field_name = tracker_property_get_name (property);
@@ -3435,7 +3435,7 @@ tracker_data_ontology_import_into_db (TrackerDataManager *manager,
TrackerProperty **properties;
guint i, n_props, n_classes;
- iface = tracker_db_manager_get_db_interface (manager->db_manager);
+ iface = tracker_db_manager_get_writable_db_interface (manager->db_manager);
classes = tracker_ontologies_get_classes (manager->ontologies, &n_classes);
properties = tracker_ontologies_get_properties (manager->ontologies, &n_props);
@@ -3878,7 +3878,7 @@ tracker_data_manager_initable_init (GInitable *initable,
tracker_data_manager_update_status (manager, "Initializing data manager");
- iface = tracker_db_manager_get_db_interface (manager->db_manager);
+ iface = tracker_db_manager_get_writable_db_interface (manager->db_manager);
#ifndef DISABLE_JOURNAL
if (manager->journal_check && is_first_time_index) {
@@ -4649,6 +4649,18 @@ tracker_data_manager_get_db_interface (TrackerDataManager *manager)
return tracker_db_manager_get_db_interface (manager->db_manager);
}
+TrackerDBInterface *
+tracker_data_manager_get_writable_db_interface (TrackerDataManager *manager)
+{
+ return tracker_db_manager_get_writable_db_interface (manager->db_manager);
+}
+
+TrackerDBInterface *
+tracker_data_manager_get_wal_db_interface (TrackerDataManager *manager)
+{
+ return tracker_db_manager_get_wal_db_interface (manager->db_manager);
+}
+
TrackerData *
tracker_data_manager_get_data (TrackerDataManager *manager)
{
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 996389e..828d078 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -79,6 +79,8 @@ TrackerOntologies * tracker_data_manager_get_ontologies (TrackerDataManage
TrackerDBManager * tracker_data_manager_get_db_manager (TrackerDataManager *manager);
TrackerDBInterface * tracker_data_manager_get_db_interface (TrackerDataManager *manager);
+TrackerDBInterface * tracker_data_manager_get_writable_db_interface (TrackerDataManager *manager);
+TrackerDBInterface * tracker_data_manager_get_wal_db_interface (TrackerDataManager *manager);
TrackerData * tracker_data_manager_get_data (TrackerDataManager *manager);
gboolean tracker_data_manager_init_fts (TrackerDBInterface *interface,
diff --git a/src/libtracker-data/tracker-data-query.c b/src/libtracker-data/tracker-data-query.c
index 7ad99f3..bce3e93 100644
--- a/src/libtracker-data/tracker-data-query.c
+++ b/src/libtracker-data/tracker-data-query.c
@@ -44,7 +44,7 @@ tracker_data_query_rdf_type (TrackerDataManager *manager,
GError *error = NULL;
TrackerOntologies *ontologies;
- iface = tracker_data_manager_get_db_interface (manager);
+ iface = tracker_data_manager_get_writable_db_interface (manager);
ontologies = tracker_data_manager_get_ontologies (manager);
stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT, &error,
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index eb9a678..927aa1e 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -366,7 +366,7 @@ tracker_data_update_get_new_service_id (TrackerData *data)
return ++data->max_ontology_id;
}
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT,
&error,
"SELECT MAX(ID) AS A FROM Resource WHERE ID <=
%d", TRACKER_ONTOLOGIES_MAX_ID);
@@ -397,7 +397,7 @@ tracker_data_update_get_new_service_id (TrackerData *data)
data->max_service_id = TRACKER_ONTOLOGIES_MAX_ID;
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT,
&error,
"SELECT MAX(ID) AS A FROM Resource");
@@ -433,7 +433,7 @@ tracker_data_update_get_next_modseq (TrackerData *data)
GError *error = NULL;
gint max_modseq = 0;
- temp_iface = tracker_data_manager_get_db_interface (data->manager);
+ temp_iface = tracker_data_manager_get_writable_db_interface (data->manager);
stmt = tracker_db_interface_create_statement (temp_iface, TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT,
&error,
"SELECT MAX(\"tracker:modified\") AS A FROM
\"rdfs:Resource\"");
@@ -685,7 +685,7 @@ query_resource_id (TrackerData *data,
gint id;
id = GPOINTER_TO_INT (g_hash_table_lookup (data->update_buffer.resource_cache, uri));
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
if (id == 0) {
id = tracker_data_query_resource_id (data->manager, iface, uri);
@@ -715,7 +715,7 @@ ensure_resource_id (TrackerData *data,
}
if (id == 0) {
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
id = tracker_data_update_get_new_service_id (data);
stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE,
&error,
@@ -807,7 +807,7 @@ tracker_data_resource_buffer_flush (TrackerData *data,
gint i, param;
GError *actual_error = NULL;
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
g_hash_table_iter_init (&iter, data->resource_buffer->tables);
while (g_hash_table_iter_next (&iter, (gpointer*) &table_name, (gpointer*) &table)) {
@@ -1195,7 +1195,7 @@ tracker_data_blank_buffer_flush (TrackerData *data,
blank_uri = g_strdup_printf ("urn:uuid:%.8s-%.4s-%.4s-%.4s-%.12s",
sha1, sha1 + 8, sha1 + 12, sha1 + 16, sha1 + 20);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
id = tracker_data_query_resource_id (data->manager, iface, blank_uri);
if (id == 0) {
@@ -1467,7 +1467,7 @@ get_property_values (TrackerData *data,
table_name = tracker_property_get_table_name (property);
field_name = tracker_property_get_name (property);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT,
&error,
"SELECT \"%s\" FROM \"%s\" WHERE ID = ?",
@@ -1538,7 +1538,7 @@ get_old_property_values (TrackerData *data,
if (tracker_property_get_fulltext_indexed (property)) {
TrackerDBInterface *iface;
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
if (!data->resource_buffer->fts_updated && !data->resource_buffer->create) {
TrackerOntologies *ontologies;
@@ -2189,7 +2189,7 @@ cache_delete_resource_type_full (TrackerData *data,
GError *error = NULL;
TrackerOntologies *ontologies;
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
ontologies = tracker_data_manager_get_ontologies (data->manager);
if (!single_type) {
@@ -2491,7 +2491,7 @@ tracker_data_delete_statement (TrackerData *data,
resource_buffer_switch (data, graph, subject, subject_id);
ontologies = tracker_data_manager_get_ontologies (data->manager);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
if (object && g_strcmp0 (predicate, TRACKER_PREFIX_RDF "type") == 0) {
class = tracker_ontologies_get_class_by_uri (ontologies, object);
@@ -2814,7 +2814,7 @@ tracker_data_insert_statement_with_uri (TrackerData *data,
g_return_if_fail (data->in_transaction);
ontologies = tracker_data_manager_get_ontologies (data->manager);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
property = tracker_ontologies_get_property_by_uri (ontologies, predicate);
if (property == NULL) {
@@ -2940,7 +2940,7 @@ tracker_data_insert_statement_with_string (TrackerData *data,
g_return_if_fail (data->in_transaction);
ontologies = tracker_data_manager_get_ontologies (data->manager);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
property = tracker_ontologies_get_property_by_uri (ontologies, predicate);
if (property == NULL) {
@@ -3047,7 +3047,7 @@ tracker_data_update_statement_with_uri (TrackerData *data,
g_return_if_fail (data->in_transaction);
ontologies = tracker_data_manager_get_ontologies (data->manager);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
property = tracker_ontologies_get_property_by_uri (ontologies, predicate);
if (property == NULL) {
@@ -3262,7 +3262,7 @@ tracker_data_update_statement_with_string (TrackerData *data,
g_return_if_fail (data->in_transaction);
ontologies = tracker_data_manager_get_ontologies (data->manager);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
property = tracker_ontologies_get_property_by_uri (ontologies, predicate);
if (property == NULL) {
@@ -3477,7 +3477,7 @@ tracker_data_begin_transaction (TrackerData *data,
data->blank_buffer.table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
}
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
tracker_db_interface_execute_query (iface, NULL, "PRAGMA cache_size = %d",
TRACKER_DB_CACHE_SIZE_UPDATE);
@@ -3525,7 +3525,7 @@ tracker_data_commit_transaction (TrackerData *data,
g_return_if_fail (data->in_transaction);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
tracker_data_update_buffer_flush (data, &actual_error);
if (actual_error) {
@@ -3620,7 +3620,7 @@ tracker_data_rollback_transaction (TrackerData *data)
data->in_transaction = FALSE;
data->in_ontology_transaction = FALSE;
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
tracker_data_update_buffer_clear (data);
@@ -3778,7 +3778,7 @@ tracker_data_replay_journal (TrackerData *data,
tracker_db_journal_reader_get_resource (reader, &id, &uri);
- iface = tracker_data_manager_get_db_interface (data->manager);
+ iface = tracker_data_manager_get_writable_db_interface (data->manager);
stmt = tracker_db_interface_create_statement (iface,
TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE, &new_error,
"INSERT INTO Resource (ID, Uri) VALUES
(?, ?)");
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 3ca253e..b157e76 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -96,6 +96,7 @@ typedef enum {
typedef struct {
TrackerDBInterface *iface;
+ TrackerDBInterface *wal_iface;
const gchar *file;
const gchar *name;
gchar *abs_filename;
@@ -107,7 +108,7 @@ typedef struct {
} TrackerDBDefinition;
static TrackerDBDefinition db_base = {
- NULL,
+ NULL, NULL,
"meta.db",
"meta",
NULL,
@@ -934,7 +935,7 @@ tracker_db_manager_optimize (TrackerDBManager *db_manager)
g_info (" Checking database is not in use");
- iface = tracker_db_manager_get_db_interface (db_manager);
+ iface = tracker_db_manager_get_writable_db_interface (db_manager);
/* Check if any connections are open? */
if (G_OBJECT (iface)->ref_count > 1) {
@@ -1050,6 +1051,44 @@ tracker_db_manager_get_db_interface (TrackerDBManager *db_manager)
return interface;
}
+static TrackerDBInterface *
+init_writable_db_interface (TrackerDBManager *db_manager)
+{
+ TrackerDBInterface *iface;
+ GError *error = NULL;
+ gboolean readonly;
+
+ /* Honor anyway the DBManager readonly flag */
+ readonly = (db_manager->flags & TRACKER_DB_MANAGER_READONLY) != 0;
+ iface = tracker_db_manager_create_db_interface (db_manager, readonly, &error);
+ if (error) {
+ g_critical ("Error opening readwrite database: %s", error->message);
+ g_error_free (error);
+ }
+
+ return iface;
+}
+
+TrackerDBInterface *
+tracker_db_manager_get_writable_db_interface (TrackerDBManager *db_manager)
+{
+ if (db_manager->db.iface == NULL) {
+ db_manager->db.iface = init_writable_db_interface (db_manager);
+ }
+
+ return db_manager->db.iface;
+}
+
+TrackerDBInterface *
+tracker_db_manager_get_wal_db_interface (TrackerDBManager *db_manager)
+{
+ if (db_manager->db.wal_iface == NULL) {
+ db_manager->db.wal_iface = init_writable_db_interface (db_manager);
+ }
+
+ return db_manager->db.wal_iface;
+}
+
/**
* tracker_db_manager_has_enough_space:
*
diff --git a/src/libtracker-data/tracker-db-manager.h b/src/libtracker-data/tracker-db-manager.h
index becbd45..53f73a4 100644
--- a/src/libtracker-data/tracker-db-manager.h
+++ b/src/libtracker-data/tracker-db-manager.h
@@ -63,6 +63,9 @@ void tracker_db_manager_remove_all (TrackerDBManager
void tracker_db_manager_optimize (TrackerDBManager *db_manager);
const gchar * tracker_db_manager_get_file (TrackerDBManager *db_manager);
TrackerDBInterface *tracker_db_manager_get_db_interface (TrackerDBManager *db_manager);
+TrackerDBInterface *tracker_db_manager_get_writable_db_interface (TrackerDBManager *db_manager);
+TrackerDBInterface *tracker_db_manager_get_wal_db_interface (TrackerDBManager *db_manager);
+
void tracker_db_manager_ensure_locations (TrackerDBManager *db_manager,
GFile *cache_location,
GFile *data_location);
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index ea7298c..97e29f8 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -508,8 +508,7 @@ public class Tracker.Sparql.Query : Object {
return result;
}
- DBStatement prepare_for_exec (string sql) throws DBInterfaceError, Sparql.Error, DateError {
- var iface = manager.get_db_interface ();
+ DBStatement prepare_for_exec (DBInterface iface, string sql) throws DBInterfaceError, Sparql.Error,
DateError {
if (iface == null) {
throw new DBInterfaceError.OPEN_ERROR ("Error opening database");
}
@@ -542,8 +541,8 @@ public class Tracker.Sparql.Query : Object {
return stmt;
}
- DBCursor? exec_sql_cursor (string sql, PropertyType[]? types, string[]? variable_names) throws
DBInterfaceError, Sparql.Error, DateError {
- var stmt = prepare_for_exec (sql);
+ DBCursor? exec_sql_cursor (DBInterface iface, string sql, PropertyType[]? types, string[]?
variable_names) throws DBInterfaceError, Sparql.Error, DateError {
+ var stmt = prepare_for_exec (iface, sql);
return stmt.start_sparql_cursor (types, variable_names);
}
@@ -563,8 +562,9 @@ public class Tracker.Sparql.Query : Object {
DBCursor? execute_select_cursor () throws DBInterfaceError, Sparql.Error, DateError {
SelectContext context;
string sql = get_select_query (out context);
+ var iface = manager.get_db_interface ();
- return exec_sql_cursor (sql, context.types, context.variable_names);
+ return exec_sql_cursor (iface, sql, context.types, context.variable_names);
}
string get_ask_query () throws DBInterfaceError, Sparql.Error, DateError {
@@ -599,7 +599,8 @@ public class Tracker.Sparql.Query : Object {
}
DBCursor? execute_ask_cursor () throws DBInterfaceError, Sparql.Error, DateError {
- return exec_sql_cursor (get_ask_query (), new PropertyType[] { PropertyType.BOOLEAN }, new
string[] { "result" });
+ var iface = manager.get_db_interface ();
+ return exec_sql_cursor (iface, get_ask_query (), new PropertyType[] { PropertyType.BOOLEAN },
new string[] { "result" });
}
private void parse_from_or_into_param () throws Sparql.Error {
@@ -752,7 +753,8 @@ public class Tracker.Sparql.Query : Object {
sql.append (pattern_sql.str);
sql.append (")");
- var cursor = exec_sql_cursor (sql.str, null, null);
+ var iface = manager.get_writable_db_interface ();
+ var cursor = exec_sql_cursor (iface, sql.str, null, null);
int n_solutions = 0;
while (cursor.next ()) {
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index 14447e1..edec19f 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -106,12 +106,15 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection, AsyncInitabl
}
static void wal_hook (DBInterface iface, int n_pages) {
+ var manager = (Data.Manager) iface.get_user_data ();
+ var wal_iface = manager.get_wal_db_interface ();
+
if (n_pages >= 10000) {
// do immediate checkpointing (blocking updates)
// to prevent excessive wal file growth
- wal_checkpoint (iface, true);
+ wal_checkpoint (wal_iface, true);
} else if (n_pages >= 1000) {
- wal_checkpoint_on_thread (iface);
+ wal_checkpoint_on_thread (wal_iface);
}
}
@@ -129,7 +132,7 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection, AsyncInitabl
false, false, 100, 100);
data_manager.init ();
- var iface = data_manager.get_db_interface ();
+ var iface = data_manager.get_writable_db_interface ();
iface.sqlite_wal_hook (wal_hook);
} catch (Error e) {
init_error = e;
diff --git a/src/tracker-store/tracker-resources.vala b/src/tracker-store/tracker-resources.vala
index 96b729c..ed34a5f 100644
--- a/src/tracker-store/tracker-resources.vala
+++ b/src/tracker-store/tracker-resources.vala
@@ -174,7 +174,7 @@ public class Tracker.Resources : Object {
var request = DBusRequest.begin (sender, "Resources.Sync");
var data_manager = Tracker.Main.get_data_manager ();
var data = data_manager.get_data ();
- var iface = data_manager.get_db_interface ();
+ var iface = data_manager.get_writable_db_interface ();
// wal checkpoint implies sync
Tracker.Store.wal_checkpoint (iface, true);
diff --git a/src/tracker-store/tracker-store.vala b/src/tracker-store/tracker-store.vala
index 20aa212..801a539 100644
--- a/src/tracker-store/tracker-store.vala
+++ b/src/tracker-store/tracker-store.vala
@@ -217,7 +217,7 @@ public class Tracker.Store {
query_task.in_thread (cursor);
} else {
var data = task.data_manager.get_data ();
- var iface = task.data_manager.get_db_interface ();
+ var iface = task.data_manager.get_writable_db_interface ();
iface.sqlite_wal_hook (wal_hook);
if (task.type == TaskType.UPDATE) {
@@ -265,18 +265,20 @@ public class Tracker.Store {
static void wal_hook (DBInterface iface, int n_pages) {
// run in update thread
+ var manager = (Data.Manager) iface.get_user_data ();
+ var wal_iface = manager.get_wal_db_interface ();
debug ("WAL: %d pages", n_pages);
if (n_pages >= 10000) {
// do immediate checkpointing (blocking updates)
// to prevent excessive wal file growth
- wal_checkpoint (iface, true);
+ wal_checkpoint (wal_iface, true);
} else if (n_pages >= 1000) {
if (AtomicInt.compare_and_exchange (ref checkpointing, 0, 1)) {
// initiate asynchronous checkpointing (not blocking updates)
try {
- checkpoint_pool.push (iface);
+ checkpoint_pool.push (wal_iface);
} catch (Error e) {
warning (e.message);
AtomicInt.set (ref checkpointing, 0);
@@ -286,11 +288,8 @@ public class Tracker.Store {
}
static void checkpoint_dispatch_cb (DBInterface iface) {
- // run in checkpoint thread, we must fetch the right
- // interface for this thread.
- var manager = (Data.Manager) iface.get_user_data ();
-
- wal_checkpoint (manager.get_db_interface (), false);
+ // run in checkpoint thread
+ wal_checkpoint (iface, false);
AtomicInt.set (ref checkpointing, 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]