apache/cassandra · error

Invalid negative latency in hint delivery delay

Error message

Invalid negative latency in hint delivery delay: {}

What it means

HintsServiceMetrics.updateDelayMetrics guard: the computed hint delivery delay (current time minus hint creation timestamp) was negative, which is impossible under a monotonic clock; typically caused by clock skew between nodes. The bogus sample is logged and skipped.

Solutions

  1. Check NTP/time synchronization on the nodes exchanging hints.
  2. Ignore if transient; the sample is not recorded.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/metrics/HintsServiceMetrics.java:101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/3f82d5bae725e52c. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/metrics/HintsServiceMetrics.java:101

                                                                                               .build(address -> Metrics.histogram(factory.createMetricName("Hint_delays-"+address.toString().replace(':', '.')), false));

    // because at the time of static hintsFileSize being initialized,
    // HintsService.instance is null / is not initialized yet so usage of method reference is not possible,
    // so this is the workaround.
    private static class TotalHintsSizeGauge implements Gauge<Long>, Serializable
    {
        @Override
        public Long getValue()
        {
            return HintsService.instance.getTotalHintsSize();
        }
    }

    public static void updateDelayMetrics(InetAddressAndPort endpoint, long delay)
    {
        if (delay <= 0)
        {
            logger.warn("Invalid negative latency in hint delivery delay: {}", delay);
            return;
        }

        globalDelayHistogram.update(delay);
        delayByEndpoint.get(endpoint).update(delay);
    }

    public static long getDelayCount(InetAddressAndPort endpoint)
    {
        return delayByEndpoint.get(endpoint).getCount();
    }
}

View on GitHub (pinned to 88fd0f6a0e)