You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2019/01/26 04:02:08 UTC
[kudu] branch master updated: KUDU-2456 Limit number of pending
transactions logged
This is an automated email from the ASF dual-hosted git repository.
granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new f1a6335 KUDU-2456 Limit number of pending transactions logged
f1a6335 is described below
commit f1a6335ab3a55b3838338c4591a634d761c7344f
Author: Bankim Bhavsar <ba...@cloudera.com>
AuthorDate: Tue Jan 15 09:55:56 2019 -0800
KUDU-2456 Limit number of pending transactions logged
Transaction tracker logs all pending transaction with some backoff.
However there can be large number of transactions and logging
all of them can be overwhelming. Hence limit logging of pending
transactions to a small number like 50.
Change-Id: I626adfea269a15b5cadd13876c940ba5bfdcfb03
Reviewed-on: http://gerrit.cloudera.org:8080/12240
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Grant Henke <gr...@apache.org>
---
src/kudu/tablet/transactions/transaction_tracker.cc | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/kudu/tablet/transactions/transaction_tracker.cc b/src/kudu/tablet/transactions/transaction_tracker.cc
index b23ef9e..1c7d310 100644
--- a/src/kudu/tablet/transactions/transaction_tracker.cc
+++ b/src/kudu/tablet/transactions/transaction_tracker.cc
@@ -18,6 +18,7 @@
#include "kudu/tablet/transactions/transaction_tracker.h"
#include <algorithm>
+#include <cstddef>
#include <limits>
#include <mutex>
#include <ostream>
@@ -205,6 +206,7 @@ void TransactionTracker::WaitForAllToFinish() const {
}
Status TransactionTracker::WaitForAllToFinish(const MonoDelta& timeout) const {
+ static constexpr size_t kMaxTxnsToPrint = 50;
int wait_time_us = 250;
int num_complaints = 0;
MonoTime start_time = MonoTime::Now();
@@ -228,9 +230,11 @@ Status TransactionTracker::WaitForAllToFinish(const MonoDelta& timeout) const {
if (now > next_log_time) {
LOG(WARNING) << Substitute("TransactionTracker waiting for $0 outstanding transactions to"
" complete now for $1", txns.size(), diff.ToString());
- LOG(INFO) << "Dumping currently running transactions: ";
- for (const auto& driver : txns) {
- LOG(INFO) << driver->ToString();
+ LOG(INFO) << Substitute("Dumping up to $0 currently running transactions: ",
+ kMaxTxnsToPrint);
+ const auto num_txn_limit = std::min(txns.size(), kMaxTxnsToPrint);
+ for (auto i = 0; i < num_txn_limit; i++) {
+ LOG(INFO) << txns[i]->ToString();
}
num_complaints++;