summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_persistent.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-29 10:49:00 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-29 10:49:00 +1100
commit023d09cd38d20ff9d69ac3e9d9fee96ad90ff76e (patch)
tree2887c974b120bc7e5b04274d1d2545588b4e4b05 /ctdb/server/ctdb_persistent.c
parenta4b8a17b26f57497aac184cc36ca5ee376d0d9c3 (diff)
downloadsamba-023d09cd38d20ff9d69ac3e9d9fee96ad90ff76e.tar.gz
samba-023d09cd38d20ff9d69ac3e9d9fee96ad90ff76e.tar.xz
samba-023d09cd38d20ff9d69ac3e9d9fee96ad90ff76e.zip
Revert "update the "uptime" command to indicate the "time since last" is the time since the last recovery OR failover."
This reverts commit 3b0d44497800a16400d05a30bdaf6e6c285d4b36. (This used to be ctdb commit cb36bbb5418290e8e5b770d2d836285b15da2a6f)
Diffstat (limited to 'ctdb/server/ctdb_persistent.c')
-rw-r--r--ctdb/server/ctdb_persistent.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index cb77bf092d..3c51742b1c 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -604,6 +604,26 @@ int32_t ctdb_control_trans2_error(struct ctdb_context *ctdb,
return 0;
}
+/**
+ * Tell whether a transaction is active on this node on the give DB.
+ */
+int32_t ctdb_control_trans2_active(struct ctdb_context *ctdb,
+ uint32_t db_id)
+{
+ struct ctdb_db_context *ctdb_db;
+
+ ctdb_db = find_ctdb_db(ctdb, db_id);
+ if (!ctdb_db) {
+ DEBUG(DEBUG_ERR,(__location__ " Unknown db 0x%08x\n", db_id));
+ return -1;
+ }
+
+ if (ctdb_db->transaction_active) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
/*
backwards compatibility: