Skip to content

[P3] Batch replication IOPs overflows above 9,223,372,036 objects #54

Closed

Description

@Vonng

The replication view of mcli batch status still multiplies the cumulative object count by time.Second as int64 before converting to float64. It can display negative IOPs once the count reaches 9,223,372,037 objects.

Confirmed on main at 18ea0a1ae04f69c7ae7c8f8b11329109ae7dcf71, and present in mcli 20261025. Suggested priority: P3: this is a display calculation defect at a very large cumulative object count, with no demonstrated effect on transferred data, job completion or rate limiting.

The remaining expression is in batchJobMetricsUI.View:

objectsPerSec := float64(int64(time.Second)*m.metric.Replicate.Objects) / float64(accElapsedTime)

To reproduce, construct initBatchJobMetricsUI("audit"), set its metric to a replicate job with StartTime = time.Unix(1, 0), LastUpdate = StartTime.Add(time.Second), and Replicate.Objects = 9223372037, then render View():

Objects: 9223372037
IOPs:    -9223372036.71 objs/s

Expected IOPs: 9223372037.00 objs/s. The largest count whose intermediate multiplication fits is math.MaxInt64 / 1e9 = 9223372036. The overflow threshold depends on cumulative object count, even for a long-running job; it is not a throughput threshold. Byte throughput in this view already divides by elapsed seconds correctly.

Convert before multiplying, or directly compute float64(Objects) / accElapsedTime.Seconds(), retaining the existing positive-duration guard. This is the same arithmetic defect class as #48 in a separate command; it does not invalidate the site-resync repair or require reopening that issue.

Regression acceptance:

  • Render exact signed rate values for zero, threshold minus one, threshold, threshold plus one, and math.MaxInt64 object counts.
  • Include 1-second and long elapsed durations; positive counts must not render a negative rate.
  • Zero and negative durations remain guarded, with no NaN/Inf or panic.
  • Compare the complete rendered numeric field, not a substring that could also match a negative value.
  • Keep the existing site-resync overflow regression tests passing.

Related: #53 covers missing batch-job metrics and command lifecycle, independently of this arithmetic repair.

Activity

  1. added
    bug
    on Oct 26, 2026
  2. added a commit that references this issue on Nov 3, 2026
    24eb117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions