Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when there isn't enough data #158

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

klauspost
Copy link
Collaborator

@klauspost klauspost commented Jan 5, 2021

When there isn't enough data for a full segment the segment duration will be 0 causing a crash.

Before:

λ go build && warp analyze warp-mixed-2021-01-04[011541]-58G4.csv.zst
1481 operations loaded... Done!
panic: internal error: so.PerSegDuration <= 0

goroutine 77 [running]:
github.com/minio/warp/pkg/bench.Operations.Segment(0xc00038e000, 0x0, 0xe9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        e:/gopath/src/github.com/minio/warp/pkg/bench/analyze.go:142 +0x935
github.com/minio/warp/pkg/aggregate.Aggregate.func2(0xc0001800a0, 0x4, 0x5, 0xc0002e2d80, 0x4, 0x4, 0xc001bba030, 0xc0004027a0, 0xc0004027c0, 0x2)
        e:/gopath/src/github.com/minio/warp/pkg/aggregate/aggregate.go:191 +0x546
created by github.com/minio/warp/pkg/aggregate.Aggregate
        e:/gopath/src/github.com/minio/warp/pkg/aggregate/aggregate.go:164 +0x790

After:

λ go build && warp analyze warp-mixed-2021-01-04[011541]-58G4.csv.zst
1481 operations loaded... Done!
Mixed operations.
Operation: DELETE, 1%, Concurrency: 96, Duration: 53s.
 * Throughput: 0.58 obj/s

Operation: GET, 52%, Concurrency: 100, Duration: 54s.
 * Throughput: 114.06 MiB/s, 2.28 obj/s

Operation: PUT, 0%, Concurrency: 0, Duration: 0s.
Skipping PUT too few samples.

Operation: STAT, 40%, Concurrency: 99, Duration: 58s.
 * Throughput: 1.64 obj/s

Cluster Total: 106.26 MiB/s, 3.99 obj/s over 58s.

Still too little data for meaningful output, but works.

Fixes #156

When there isn't enough data for a full segment the segment duration will be 0 causing a crash.

Before:
```
λ go build && warp analyze warp-mixed-2021-01-04[011541]-58G4.csv.zst
1481 operations loaded... Done!
panic: internal error: so.PerSegDuration <= 0

goroutine 77 [running]:
github.com/minio/warp/pkg/bench.Operations.Segment(0xc00038e000, 0x0, 0xe9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        e:/gopath/src/github.com/minio/warp/pkg/bench/analyze.go:142 +0x935
github.com/minio/warp/pkg/aggregate.Aggregate.func2(0xc0001800a0, 0x4, 0x5, 0xc0002e2d80, 0x4, 0x4, 0xc001bba030, 0xc0004027a0, 0xc0004027c0, 0x2)
        e:/gopath/src/github.com/minio/warp/pkg/aggregate/aggregate.go:191 +0x546
created by github.com/minio/warp/pkg/aggregate.Aggregate
        e:/gopath/src/github.com/minio/warp/pkg/aggregate/aggregate.go:164 +0x790
```

After:
```
λ go build && warp analyze warp-mixed-2021-01-04[011541]-58G4.csv.zst
1481 operations loaded... Done!
Mixed operations.
Operation: DELETE, 1%, Concurrency: 96, Duration: 53s.
 * Throughput: 0.58 obj/s

Operation: GET, 52%, Concurrency: 100, Duration: 54s.
 * Throughput: 114.06 MiB/s, 2.28 obj/s

Operation: PUT, 0%, Concurrency: 0, Duration: 0s.
Skipping PUT too few samples.

Operation: STAT, 40%, Concurrency: 99, Duration: 58s.
 * Throughput: 1.64 obj/s

Cluster Total: 106.26 MiB/s, 3.99 obj/s over 58s.
```

Fixes minio#156
@harshavardhana harshavardhana merged commit 0797d45 into minio:master Jan 5, 2021
@klauspost klauspost deleted the fix-mixed-analysis-crash branch January 5, 2021 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while bench marking
2 participants