Comments (5)
Hi,
One thing I'm seeing is that you are capturing idx
inside the func of a goroutine which until Go 1.22 was a mistake (https://go.dev/blog/loopvar-preview). What version of Go are you using?
from pebble.
I'm using go.1.22.3
from pebble.
Overall the way the API is used is correct, this should be working. There must be some detail that's wrong. Could I get a pointer to utilities.GenerateRanges
? Just want to check that To
is indeed exclusive as this code assumes.
from pebble.
Sure, it's pretty straightforward.
// IteratorRange represents a range of numbers to chunk slices into.
type IteratorRange struct{ From, To uint64 }
// GenerateRanges generates a list of ranges from min to max with a batch size.
func GenerateRanges(min, max uint64, batchSize uint64) []IteratorRange {
if batchSize == 0 {
batchSize = 1
}
var ranges []IteratorRange
// this has to be from <= max to include the last batch
for from := min; from <= max; from += batchSize {
// without -1 the first batch will be 10-20 and the second batch will be 20-30
// with -1 the first batch will be 10-19 and the second batch will be 20-29
to := (from + batchSize) - 1
if to > max {
to = max
}
ranges = append(ranges, IteratorRange{from, to})
}
return ranges
}
from pebble.
Well, it looks like To is inclusive (it's from+batchsize-1
from pebble.
Related Issues (20)
- sstable: clean up two/single level iterator init HOT 1
- Deleted upstream dependency; bump github.com/cockroachdb/errors HOT 7
- manifest: TestInuseKeyRangesRandomized failure HOT 3
- TestMetaCrossVersion and TestMeta with no invariants failure HOT 5
- github.com/cockroachdb/pebble/internal/metamorphic: TestMeta failed HOT 6
- TestDBCompactionCrash hangs on Windows
- : failed HOT 2
- metrics: m.Compact.Duration decreases and causes panic HOT 1
- [ignore] Test Exalate sync
- db: improve context propagation for tracing of slow block loads
- [ignore] Test Exalate syncing
- [ignore] Testing sync
- github.com/cockroachdb/pebble/internal/metamorphic: TestMeta failed HOT 3
- prototype modular bloom filters
- db: offload downloads to objprovider to reduce cache and db.mu churn
- github.com/cockroachdb/pebble/internal/metamorphic: TestMeta failed HOT 4
- : failed HOT 7
- db: Download should use block cache for metadata/index block lookups
- github.com/cockroachdb/pebble/internal/metamorphic: TestMetaTwoInstance failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pebble.