Giter Club home page Giter Club logo

Comments (1)

cenkalti avatar cenkalti commented on August 26, 2024

It should describe what can happen in the event of an IO error

bbolt calls fsync after each transaction to persist changes on disk. If there is any error while writing data, transaction is rolled back and the error is returned to user. This behavior is documented on README:

bbolt/README.md

Lines 903 to 910 in 160cd29

- `Tx.Commit()` - Converts the in-memory dirty nodes and the list of free pages
into pages to be written to disk. Writing to disk then occurs in two phases.
First, the dirty pages are written to disk and an `fsync()` occurs. Second, a
new meta page with an incremented transaction ID is written and another
`fsync()` occurs. This two phase write ensures that partially written data
pages are ignored in the event of a crash since the meta page pointing to them
is never written. Partially written meta pages are invalidated because they
are written with a checksum.

It should explain why Bolt doesn't catch the signal for you (there are many good reasons)

SIGSEGV or SIGBUS signals are raised when the process tries to access protected or invalid memory address. These usually are result of database corruption as bbolt uses unsafe package and does pointer arithmetic to access parts of mmaped file. However, in nspcc-dev/neofs-node#2107 case, it makes sense to get SIGBUS because HDD was removed and mmaped region is no longer valid. bbolt should return a proper error here instead of panicking and crashing the whole process. Related #447 I've seen in nspcc-dev/neofs-node#2115 there is attempt to handle this by calling debug.SetPanicOnFault inside transactions. We could move this logic into bbolt.

from bbolt.

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.