Comment by carlsverre

15 days ago

Hi! I'm the author and the person who was on a road trip when I decided to do this experiment back in July. I'm super excited to finally get the blog post out, and even better, alongside a post describing the root cause process that went into the project. You can read about Tailscale's story here: https://tailscale.com/blog/sqlite-wal-reset-bug

I'm only sad that I didn't put SQLite under test earlier in the year, or I would have found this issue right away. If you look at the workload[1], you can see how simple it is. Exactly the same kind of workload we write every day to help our customers find bugs.

If you have any questions about our process or how debugging with Antithesis works, please let me know! Thanks for reading!

[1]: https://github.com/antithesishq/sqlite/blob/3.51.2-instrumen...

How difficult would it have been to isolate that problem if you didn't already know the SQLite subsystem it was in? This feels, to someone relatively ignorant of the SQLite / Tailscale / Antithesis architectures as a "hindsight is 20/20" kind of thing, but I'm open to learning more.

  • Great question! The general approach we take with transactional systems like this is to put reachability statements throughout the complex stateful machinery and then stress-test them in Antithesis.

    The workload I put in place does exactly that[1]. It runs a write workload from multiple processes concurrently on the same SQLite database to cause writes to build up in the WAL, and runs checkpoints concurrently. This exercises the portion of the WAL code that, from a trivial read-through, is most likely to contain bugs (and turns out, did!).

    Said differently, this is exactly the approach we take with all stateful transactional systems. I am only sad that I didn't do this experiment months earlier, as it would have saved Tailscale and the SQLite team a lot of time.

    [1]: https://github.com/antithesishq/sqlite/blob/3.51.2-instrumen...

    • > This exercises the portion of the WAL code that, from a trivial read-through, is most likely to contain bugs (and turns out, did!).

      Suuure. So why exactly haven't you found this bug already a long time ago? I mean it is trivially obvious that this is where bugs in SQLite would be, right?

      SQLite is open source and is one of the most popular databases, surely testing it to find bugs would also be obvious?

      9 replies →

So you got information where the bug is, and now you brag that your AI friend found it quickly :joy:

Go find bugs that haven't been yet found, and then brag about them :joy:

you asserted that Antithesis would have found it right away, but it seems like from your write-up that you first set up instrumentation on the source, then told it to reproduce the WAL bug.

i don't feel like i gained a strong appreciation for what the actual Antithesis capabilities are or why you had confidence this was anything the Antithesis tools would have helped find? i want to know more about what kind of analysis or capabilities Antithesis has and how it could have helped find the issue. what's clear is that Antithesis could confirm an already found issue. and even there I don't feel like I gained any connection or knowledge or understanding of what the tooling was doing or how it would help. i'd really like more technical meat to this post to understand the value proposition.

Nice article, but could you get someone to fix the blog layout? Having the author card pinned to the window rather than being able to scroll past it is distracting.

> I'm only sad that I didn't put SQLite under test earlier in the year, or I would have found this issue right away

Unless you guys routinely add assertions to libraries I don't see how you would have caught this?

I mean for sure databases should guard against lost writes but how would you have known to add that particular assert?