Add write-through behavior to ChangesStore
commit71b9fc9a4211a74f4f3e3039da9fa5c30468cf2d
authorJake Bailey <jakebailey@fb.com>
Thu, 19 May 2022 00:37:45 +0000 (18 17:37 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 19 May 2022 00:37:45 +0000 (18 17:37 -0700)
treed41287c125d8c7cf6e0dcc8160e778597eab5f3c
parentaf72982a203d903457e75668cef24a41341f68b8
Add write-through behavior to ChangesStore

Summary:
When the changes stack is empty, write changes through to the underlying fallback store.

This lets us model the local changes behavior for the naming table in hh_server: for writes, when the stack is empty, we write to sharedmem. For reads, we read from the stack, then fallback to sharedmem, then fallback to the SQLite DB. If ChangesStore supports write-through behavior, then we can model that behavior with a ChangesStore wrapping a DeltaStore, where the delta is a sharedmem Store and the DeltaStore's fallback is the SQLite DB. This diff refactors hackrs_provider_backend::naming_table to work this way.

Reviewed By: shayne-fletcher

Differential Revision: D36465267

fbshipit-source-id: 4bba55b87a7d314f74b253ef0a17496f9080e750
hphp/hack/src/providers/hackrs_provider_backend/naming_table.rs
hphp/hack/src/rupro/datastore/changes_store.rs