blugelabs / bluge

indexing library for Go
Apache License 2.0
1.88k stars 122 forks source link

Fix typo #39

Closed rubiojr closed 3 years ago

rubiojr commented 3 years ago

Taking the chance to ask: how bad is this?

This happens often when using a reader that doesn't come from a writer and the writer isn't closed, but seems to be harmless in my tests.

mschoch commented 3 years ago

Can you push another commit adding yourself to the AUTHORS file?

Regarding the issue you described, I'm wondering if the reader is seeing a snapshot file that isn't complete yet. I have not seen that, but seems plausible under the right workload that could happen. Do you happen to have a test case that reproduces it that you could share? If not, perhaps you could share a bit more details about the workload.

Even if that is happen, it should be detected because the snapshots have CRC, which would fail for an incomplete snapshot. But, it may make sense for us to write snapshots in a different filename, and then rename them, only after they're complete. I think it would be a cleaner design if reading incomplete snapshots didn't happen all the time.

rubiojr commented 3 years ago

Can you push another commit adding yourself to the AUTHORS file?

Done.

Do you happen to have a test case that reproduces it that you could share? If not, perhaps you could share a bit more details about the workload.

Not yet, but I'm trying to come up with an isolated snippet. The only thing that seems reproducible so far is that this doesn't happen when using writer.Reader() when searching, or if I close the writer before searching/reading.

mschoch commented 3 years ago

I have broken the other issue out separately here: https://github.com/blugelabs/bluge/issues/40