Summary: I had copy pasted these error messages from rocks db code. lets make them say sqlite instead
Reviewed By: xavierd
Differential Revision: D40803445
fbshipit-source-id: 7c2060dc8b611a7d28c3dbb4163955458ce218b9
Summary:
opening the localstore can delay starting up the EdenFS server. I don't think
we use the Sqlite LocalStore any where (though we use RockDB for the overlay).
But I am going to allow the RockDbLocalStore to use a delayed open pattern, so
might as well teach sqlite to work this way to.
Reviewed By: mshroyer, xavierd
Differential Revision: D38839387
fbshipit-source-id: 1496d421fe210cd8d409c6fcc4303ad79dab066a
Summary:
We didn't have unit tests for `SqliteStatement`, `SqliteDatabase` nor `PersistentSqliteStatement`.
This diff adds some tests to cover it.
Reviewed By: genevievehelsel
Differential Revision: D36297019
fbshipit-source-id: e622b95b1426c9ade9cc884b65f4dc84bfb96f93
Summary:
Original commit changeset: 9f97d166f621
Original Phabricator Diff: D35624964 (ed17b57094)
This is the exact backout of the backout diff, but depends on D36264955 which fixes the underlying issue that was causing the crash.
Reviewed By: chadaustin
Differential Revision: D36254037
fbshipit-source-id: a5c62ed3d41a6da467ff76abd8239912dcc2c1d0
Summary:
We were seeing a crash on Windows and this diff fixes that.
`sqlite3_reset` will return the same error code as it did in `sqlite3_step` if there is any error happened during that statement execution.
This was fine previously because the exception was handled when we call `sqlite3_step`. However after my previous diff, we are calling `sqlite3_reset` in the newly introduced scope guard.
This means we will be rethrowing the same exception in the destructor, causing EdenFS to crash.
Reviewed By: xavierd
Differential Revision: D36264955
fbshipit-source-id: 26322307b366ba637431144ee132ca82f894f21f
Summary:
Original commit changeset: ac900be288d0
Original Phabricator Diff: D35321408 (36b3b05242)
Original commit changeset: 9f97d166f621
Original Phabricator Diff: D35624964 (ed17b57094)
We are seeing some crashes in overlay and it should be these two diffs. Backing them out for now.
Reviewed By: kmancini
Differential Revision: D36254038
fbshipit-source-id: 19cf91e425f3caa20853077cfe18ca8e34a0da9a
Summary:
We often get reports complaining `treeoverlay.db-WAL` is too big on user's machine.
The issue here is that, we never get a chance to let SQLite run wal checkpoint because we never close the connection to SQLite database.
In which case, we can run the maintenance job ourselves to keep the journal file small. This diff adds a periodical task in EdenServer to give tree overlay a chance to run `wal_checkpoint`.
Reviewed By: xavierd
Differential Revision: D35321408
fbshipit-source-id: ac900be288d0919785876b93a9bde2166871c56a
Summary:
In my next diff, I am adding a maintenance task for SQLite to run wal checkpoints periodically. However, prepared select statements will prevent wal checkpoint from succeeding if they are not reset.
This diff introduces a `SqliteStatement::Guard` to reset the prepared statement correctly, and this has proven to unblock wal checkpoint for overlays.
Reviewed By: xavierd
Differential Revision: D35624964
fbshipit-source-id: 9f97d166f62131ae5cff7e29afe9e49d6398e7ef
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.
Reviewed By: fanzeyi
Differential Revision: D33407812
fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
Summary: This diff replaces `SqliteStatement` in `TreeOverlayStore` with the new `PersistendSqliteStatement`.
Reviewed By: chadaustin
Differential Revision: D26656314
fbshipit-source-id: dbbfeddd52d3be2a1b5d3b6121d3694c41841fd5
Summary:
This diff makes `SqliteStatement` to construct persistent statement by default.
This change should be harmless if the caching assumption is not true. If the statement is not cached by the caller, it's probably on a non-critical path.
Reviewed By: chadaustin
Differential Revision: D26639365
fbshipit-source-id: 26af6ccdba036dc0fccf774e9ffb6bb2a014c5ff
Summary:
This diff adds `TreeOverlayStore` that is used in following diffs to store tree
data in SQLite database. This class encapsulates the SQL statments needed for
storing trees.
Reviewed By: chadaustin
Differential Revision: D24083787
fbshipit-source-id: 61c08617fe50e7eac94c614948f5ba5355dba71a
Summary:
This diff adds more logging to SQLite so we can see what statements are being
executed in logs. Setting `eden.fs.sqlite=DBG9` will show every SQL statement
being executed and bound values.
Reviewed By: chadaustin
Differential Revision: D25223472
fbshipit-source-id: ed089b7ec112c75d9f7bc63d9fe53f0ec2bd6420
Summary:
This diff introduces `transaction()` to `SqliteDatabase` to make managing SQLite transaction easier.
Usage:
```
db->transaction([](auto& txn) {
SqliteStatement(txn, "SELECT ...");
SqliteStatement(txn, "INSERT ...");
});
```
It will automatically roll back when exception happens, and commit when the closure finishes.
Reviewed By: chadaustin
Differential Revision: D25102179
fbshipit-source-id: 5a4ced8c6eb8016e15b8132be2b5abcc9760e2f9
Summary: This diff adds an alias `SqliteDatabase::Connection` to make it less mouthful when we want to reference the type of the SQLite connection we created
Reviewed By: xavierd
Differential Revision: D25386777
fbshipit-source-id: a6a58d522200fe0bf35ac52f6dad16063c0389d0
Summary:
The EdenFS codebase uses folly/logging/xlog to log, but we were still relying
on glog for the various CHECK macros. Since xlog also contains equivalent CHECK
macros, let's just rely on them instead.
This is mostly codemodded + arc lint + various fixes to get it compile.
Reviewed By: chadaustin
Differential Revision: D24871174
fbshipit-source-id: 4d2a691df235d6dbd0fbd8f7c19d5a956e86b31c
Summary:
This diff adds a new constructor to `SqliteDatabase` to allow creation of
in-memory SQLite database. This can come in handy in testing.
Reviewed By: xavierd
Differential Revision: D24083579
fbshipit-source-id: ad6dd8b1c20392a882c1f164ef1f8af2f0ba11f8
Summary:
We have a lot of warnings on Windows, which in case of a build failure makes
it hard to find the actual cause, let's start by silencing the Sqlite ones.
Reviewed By: wez
Differential Revision: D21238029
fbshipit-source-id: 95763dcd06af77d45b7a769a93e0bbd6cabfa9c3
Summary:
This diff introduces a sqlite based overlay, which stores the directory inode and its entries in the sqlite database. This is similar to FsOverlay but doesn't support all the functionality. Sqlite overlay in this diff is only designed to handles the requirement for Eden on Windows.
We did not build sqlite overlay as a virtual class because as of this diff the interface and functionality of this is different from fsOverlay.
Reviewed By: simpkins
Differential Revision: D20480870
fbshipit-source-id: c87cb2ffd11c6c0c7a10bc8dfaf6164e0e442b2b
Summary:
The `eden/fs/sqlite` code uses `eden/fs/utils/PathFuncs.h`, so add a proper
dependency on the `eden_utils` library.
Reviewed By: pkaush
Differential Revision: D18652105
fbshipit-source-id: b8dffd93971ab5efb71d7bc3c2dcb62249b3915b
Summary:
Update the copyright & license headers in CMake files to reflect the
relicensing to GPLv2
Reviewed By: wez
Differential Revision: D15487079
fbshipit-source-id: 715e559464c19a0070d6e55a095b3fc7d61ad2f8
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2
Reviewed By: wez
Differential Revision: D15487078
fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
Summary:
We need to call sqlite3_close() if sqlite3_open() fails to avoid leaking the
DB object that was allocated.
Reviewed By: chadaustin, strager
Differential Revision: D8529745
fbshipit-source-id: 1087dac8343b8b3120c89bd3c9a250970e69df8e
Summary:
Adds a SQLite storage implementation and makes it the
default engine for integration tests; this requires fewer resources
to run and the integration tests thus run faster and more reliably.
In the future we may add a configuration option to remember the
storage engine that was used as it is currently not "safe" to switch
from one to the other because the hgproxyhash data cannot be
recreated without re-importing a revision.
Reviewed By: simpkins
Differential Revision: D6919456
fbshipit-source-id: 3afbfafb190cca0e3c797cd9b7cd051768575a8c