Commit df056272 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4876], report txn manager status to engine status

git-svn-id: file:///svn/toku/tokudb@44054 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9ed2d3f2
......@@ -82,8 +82,6 @@ typedef enum {
TXN_CLOSE, // should be sum of aborts and commits
TXN_NUM_OPEN, // should be begin - close
TXN_MAX_OPEN, // max value of num_open
TXN_OLDEST_LIVE, // xid of oldest live transaction
TXN_OLDEST_STARTTIME, // start time of oldest live txn
TXN_STATUS_NUM_ROWS
} txn_status_entry;
......
......@@ -29,7 +29,7 @@ struct txn_manager {
struct toku_list prepared_and_returned_txns; // transactions that have been prepared and unresolved, and have been returned through txn_recover. We need this list so that we can restart the recovery.
};
static TXN_STATUS_S txn_manager_status;
static TXN_MANAGER_STATUS_S txn_manager_status;
BOOL garbage_collection_debug = FALSE;
......@@ -170,7 +170,7 @@ static TXNID txn_manager_get_oldest_living_xid_unlocked(
time_t * oldest_living_starttime
);
void toku_txn_manager_get_status(TOKULOGGER logger, TXN_STATUS s) {
void toku_txn_manager_get_status(TOKULOGGER logger, TXN_MANAGER_STATUS s) {
if (!txn_manager_status.initialized) {
status_init();
}
......
......@@ -13,7 +13,20 @@ extern "C" {
struct txn_manager;
void toku_txn_manager_get_status(TOKULOGGER logger, TXN_STATUS s);
typedef enum {
TXN_OLDEST_LIVE, // xid of oldest live transaction
TXN_OLDEST_STARTTIME, // start time of oldest live txn
TXN_MANAGER_STATUS_NUM_ROWS
} txn_manager_status_entry;
typedef struct {
BOOL initialized;
TOKU_ENGINE_STATUS_ROW_S status[TXN_MANAGER_STATUS_NUM_ROWS];
} TXN_MANAGER_STATUS_S, *TXN_MANAGER_STATUS;
void toku_txn_manager_get_status(TOKULOGGER logger, TXN_MANAGER_STATUS s);
void toku_txn_manager_init(TXN_MANAGER* txn_manager);
void toku_txn_manager_destroy(TXN_MANAGER txn_manager);
......
......@@ -2039,6 +2039,7 @@ env_get_engine_status_num_rows (DB_ENV * UU(env), uint64_t * num_rowsp) {
num_rows += FT_FLUSHER_STATUS_NUM_ROWS;
num_rows += FT_HOT_STATUS_NUM_ROWS;
num_rows += TXN_STATUS_NUM_ROWS;
num_rows += TXN_MANAGER_STATUS_NUM_ROWS;
num_rows += LOGGER_STATUS_NUM_ROWS;
num_rows += MEMORY_STATUS_NUM_ROWS;
num_rows += FS_STATUS_NUM_ROWS;
......@@ -2165,6 +2166,13 @@ env_get_engine_status (DB_ENV * env, TOKU_ENGINE_STATUS_ROW engstat, uint64_t ma
engstat[row++] = txnstat.status[i];
}
}
{
TXN_MANAGER_STATUS_S txn_manager_stat;
toku_txn_manager_get_status(env->i->logger, &txn_manager_stat);
for (int i = 0; i < TXN_MANAGER_STATUS_NUM_ROWS && row < maxrows; i++) {
engstat[row++] = txn_manager_stat.status[i];
}
}
{
LOGGER_STATUS_S loggerstat;
toku_logger_get_status(env->i->logger, &loggerstat);
......
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