SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
ensure head index is within range
chrislua5645d50a70a
diff --git a/weed/util/buffered_queue/buffered_queue.go b/weed/util/buffered_queue/buffered_queue.goindex 042561cdda..9c65899e9b 100644--- a/weed/util/buffered_queue/buffered_queue.go+++ b/weed/util/buffered_queue/buffered_queue.go@@ -95,10 +95,16 @@ func (q *BufferedQueue[T]) Dequeue() (T, bool) {return a, false}+ q.maybeAdjustHeadIndex()+job := q.head.items[q.head.headIndex]q.head.headIndex++q.count--+ return job, true+}++func (q *BufferedQueue[T]) maybeAdjustHeadIndex() {if q.head.headIndex == q.chunkSize {q.last.next = q.headq.head = q.head.next@@ -113,8 +119,6 @@ func (q *BufferedQueue[T]) Dequeue() (T, bool) {// fmt.Printf("Node: %+v\n", p)//}}-- return job, true}func (q *BufferedQueue[T]) PeekHead() (T, bool) {@@ -126,6 +130,8 @@ func (q *BufferedQueue[T]) PeekHead() (T, bool) {return a, false}+ q.maybeAdjustHeadIndex()+job := q.head.items[q.head.headIndex]return job, true}