Skip to content

Commit

Permalink
Merge pull request #16943 from a-robinson/clockerr
Browse files Browse the repository at this point in the history
rpc: Slightly clarify the clock offset suicide error message
  • Loading branch information
a-robinson authored Jul 10, 2017
2 parents ad576e8 + 40669dd commit f2e0676
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pkg/rpc/clock_offset.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,12 @@ func (r *RemoteClockMonitor) VerifyClockOffset(ctx context.Context) error {
r.metrics.ClockOffsetStdDevNanos.Update(int64(stdDev))

if numClocks > 0 && healthyOffsetCount <= numClocks/2 {
return errors.Errorf("fewer than half the known nodes are within the maximum offset of %s (%d of %d)", maxOffset, healthyOffsetCount, numClocks)
return errors.Errorf(
"clock synchronization error: this node is more than %s away from at least half of the known nodes (%d of %d are within the offset)",
maxOffset, healthyOffsetCount, numClocks)
}
if log.V(1) {
log.Infof(ctx, "%d of %d nodes are within the maximum offset of %s", healthyOffsetCount, numClocks, maxOffset)
log.Infof(ctx, "%d of %d nodes are within the maximum clock offset of %s", healthyOffsetCount, numClocks, maxOffset)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/clock_offset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/stop"
)

const errOffsetGreaterThanMaxOffset = "fewer than half the known nodes are within the maximum offset"
const errOffsetGreaterThanMaxOffset = "clock synchronization error: this node is more than .+ away from at least half of the known nodes"

// TestUpdateOffset tests the three cases that UpdateOffset should or should
// not update the offset for an addr.
Expand Down

0 comments on commit f2e0676

Please sign in to comment.