GithubHelp home page GithubHelp logo

Comments (7)

njaard avatar njaard commented on May 28, 2024 1

Fixed in commit 322e423

from sonnerie.

ettom avatar ettom commented on May 28, 2024

Similarly, doing

while :; do sonnerie -d db read % || break; done

on a database with about a 1000 rows and then running

sonnerie -d db compact

will result in the loop stopping with Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }.

from sonnerie.

njaard avatar njaard commented on May 28, 2024

What operating system are you on?

from sonnerie.

ettom avatar ettom commented on May 28, 2024

Arch Linux. I also tried this on a custom LFS-like embedded Linux system and got the same results. sonnerie v0.8.5 and ext4 for both.

from sonnerie.

ettom avatar ettom commented on May 28, 2024

Interesting, this doesn't seem to happen on a Linux Mint 21 machine with ext4. On that machine the compaction loop just says disregarding "db/tx.*", it is zero length on every iteration.

from sonnerie.

ettom avatar ettom commented on May 28, 2024

Interesting, this doesn't seem to happen on a Linux Mint 21 machine with ext4. On that machine the compaction loop just says disregarding "db/tx.*", it is zero length on every iteration.

Scratch that, it still happens, but a lot less often. Easy to catch it with

for i in $(seq 1 100000); do echo $i; echo "test $i $i" | sonnerie -d db add --format u || break; done

from sonnerie.

njaard avatar njaard commented on May 28, 2024

It seems like there's a race condition in the time between the completion of read_dir and the actual opening of the files. If a compaction completes in between those two actions, then some files that were previously found via the read_dir will have been deleted by the compaction.

If that happens, then I think the correct action is to try the read_dir again from the beginning. You can't simply ignore the missing files, because your read_dir necessarily will not have opened the file they'll have been compacted into.

from sonnerie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.