nsqio / go-diskqueue

A Go package providing a filesystem-backed FIFO queue
MIT License
467 stars 101 forks source link

maxBytesPerFile read check off-by-one #15

Closed xkeyideal closed 3 years ago

xkeyideal commented 4 years ago

14

xkeyideal commented 4 years ago

@ploxiln

Please see the newest pr code.

use curReadFileSize instead of maxBytesPerFile for move to next file.

TODO: each data file should embed the maxBytesPerFile as the first 8 bytes (at creation time) ensuring that the value can change without affecting runtime be solved.

ploxiln commented 4 years ago

The new curReadFileSize logic looks good to me, thanks! It will take some more time to review and validate, sorry.

xkeyideal commented 4 years ago

I use the nsqio/go-diskqueue code develop read-write separation program, for readonly and read by write, thanks for your code.

I use curReadFileSize to solve switch files avoid maxBytesPerFile cause file data error

mreiferson commented 3 years ago

The logic here looks good and addresses an outstanding TODO, I've cleaned things up in #23, so let's wrap this up there.

Thanks!