Understanding Commit Log Package

Let’s do a whiteboarding session? I’ll go pick up my Wacom tablet which is biting dust in the office, and put it to some use.

But just to quickly answer the questions:

  1. The problem I had with commit logs was that PLs were being lazily initialized. So, every time a PL gets init(), we had to replay the commit logs and check if it had anything for the PL in hand. That’s where Cache came handy. We’d lazily load the entire log in cache, so our PL inits would be faster; and all the PLs can reuse this cache. In retrospect, lazy init is complicated. We shouldn’t be doing it anymore.

  2. Mutations to PL get written to it’s 2 mutation layers, then written to the latest commit log and the cache corresponding to that commit log. This allows any new PL init() to automatically get the latest mutations from the cache, without hitting disk for the commit log.

1 Like