Skip to content

Combine skippedOperations and overriddenOperations to a single metric #33317

@dnhatn

Description

@dnhatn

Today we have two metrics for a similar thing in the Translog#Snapshot.

/**
 * The number of operations have been skipped (overridden or trimmed) in the snapshot so far.
 */
 default int skippedOperations() {
     return 0;
 }
/**
* The number of operations have been overridden (eg. superseded) in the snapshot so far.
* If two operations have the same sequence number, the operation with a lower term will be overridden by the operation
* with a higher term. Unlike {@link #totalOperations()}, this value is updated each time after {@link #next()}) is called.
*/
default int overriddenOperations() {
  return 0;
}

We can easily get this wrong with these two metrics. For example:

com.carrotsearch.randomizedtesting.RandomizedRunner$QueueUncaughtExceptionsHandler uncaughtException
16:08:45   2> AVVERTENZA: Uncaught exception in thread: Thread[elasticsearch[node_s1][generic][T#3],5,TGRP-InnerHitsIT]
16:08:45   2> java.lang.AssertionError: expected total [2711], overridden [2595], skipped [0], total sent [73]
16:08:45   2>     at __randomizedtesting.SeedInfo.seed([2A48E284B121F3B]:0)
16:08:45   2>     at 

Should we collapse these two metrics to a single one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions