You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/04/21 20:58:42 UTC
[kudu] 02/02: hybrid_clock: use different message when injecting
errors
This is an automated email from the ASF dual-hosted git repository.
adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 64cdf302eee1172242fb3a76ec8f2ac3bb75d6cb
Author: Adar Dembo <ad...@cloudera.com>
AuthorDate: Fri Apr 19 09:57:39 2019 -0700
hybrid_clock: use different message when injecting errors
The "Clock considered unsynchronized" error message is special in that if
its in the test log, report-test.sh will skip reporting. So let's make sure
it's not naturally occurring in any tests.
Without this change, hybrid_clock-test never reported any results.
Change-Id: I36a7cd22375bc465df258050f865effec75effd7
Reviewed-on: http://gerrit.cloudera.org:8080/13067
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
src/kudu/clock/system_ntp.cc | 5 ++++-
src/kudu/clock/system_unsync_time.cc | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/kudu/clock/system_ntp.cc b/src/kudu/clock/system_ntp.cc
index 23e6cf6..108056a 100644
--- a/src/kudu/clock/system_ntp.cc
+++ b/src/kudu/clock/system_ntp.cc
@@ -77,7 +77,10 @@ Status CallAdjTime(timex* tx) {
return Status::InvalidArgument("Error reading clock. ntp_adjtime() failed",
ErrnoToString(errno));
case TIME_ERROR:
- return Status::ServiceUnavailable("Error reading clock. Clock considered unsynchronized");
+ return Status::ServiceUnavailable(
+ PREDICT_FALSE(FLAGS_inject_unsync_time_errors) ?
+ "Injected clock unsync error" :
+ "Error reading clock. Clock considered unsynchronized");
default:
// TODO what to do about leap seconds? see KUDU-146
KLOG_FIRST_N(ERROR, 1) << "Server undergoing leap second. This may cause consistency issues "
diff --git a/src/kudu/clock/system_unsync_time.cc b/src/kudu/clock/system_unsync_time.cc
index 12da925..61b0c4c 100644
--- a/src/kudu/clock/system_unsync_time.cc
+++ b/src/kudu/clock/system_unsync_time.cc
@@ -39,14 +39,14 @@ Status SystemUnsyncTime::Init() {
<< "be accurate. This configuration is not suitable for "
<< "distributed clusters.";
if (PREDICT_FALSE(FLAGS_inject_unsync_time_errors)) {
- return Status::ServiceUnavailable("Error reading clock. Clock considered unsynchronized");
+ return Status::ServiceUnavailable("Injected clock unsync error");
}
return Status::OK();
}
Status SystemUnsyncTime::WalltimeWithError(uint64_t* now_usec, uint64_t* error_usec) {
if (PREDICT_FALSE(FLAGS_inject_unsync_time_errors)) {
- return Status::ServiceUnavailable("Error reading clock. Clock considered unsynchronized");
+ return Status::ServiceUnavailable("Injected clock unsync error");
}
*now_usec = GetCurrentTimeMicros();
*error_usec = 0;