719 Commits (66b9ac27aff20a38a9129537b597edd178d0606b)
 

Author SHA1 Message Date
Sayan Nandan 03e241902f Ensure that duplicated handle has same permissions
This is particularly relevant for Windows
3 years ago
Sayan Nandan ba53e5160b Use unlocks to ensure that file is readable 3 years ago
Sayan Nandan 76d184663a Add test for BGSAVE 3 years ago
Sayan Nandan d7cd1bfb70 Use different byte count for test
This test simply makes sure that the 0s written while truncating don't
reappear (they should never do)
3 years ago
Sayan Nandan 93ef949bac Manually unlock file after complete termination
The cloned flock might attempt to call the unlock but it is a cloned
descriptor!
3 years ago
Sayan Nandan 893cf1d741 Fix `FileLock::write` impl and make snaps blocking
This commit implements a tokio blocking task for mksnap and also fixes
FileLock's write method and adds a test for the same
3 years ago
Sayan Nandan b5865e500b Use Terminator for termination of all bg services
What we did in the old implementation was pure over-engineering.
We relied on CoreDB's `Drop` impl to terminate the background services.
Now this is absolutely unreliable due to the nature of async functions.
We also relied on the bgsave scheduler to release the lock upon exit
which is also unreliable because we left the service to the mercy of the
runtime. We spawned the task and didn't hold as much as a `JoinHandle`
to it. That's bad because the runtime can just abort these tasks which
may result in the lock never being released. Even though it is designed
to release the lock on Drop, the destructor may however not be called at
all.

This commit fixes all those issues by simplifying the entire impl to
use Terminator. Now the background save and snapshot services run
independently, in their own tasks. Whenever the user passes a SIGINT,
we tell everyone to quit. The listeners understand that this is the
last query they'll process and the background save tasks exit almost
immediately. But what if some data was modified by this last query...?

No worries, that is completely handled by main(). The lock that BGSAVE
leaves is immediately (almost) returned to main and main will attempt
to flush the data almost immediately. That's how we maintain reliability
3 years ago
Sayan Nandan 78e9441564 Spawn blocking I/O tasks on a dedicated thread 3 years ago
Sayan Nandan 7d1b44a57f The snapshot service had similar bugs that were
fixed
3 years ago
Sayan Nandan 5a7f17db14 Fix strong count calculation logic
See the added comment for more context
3 years ago
Sayan Nandan 5d4650712f Fix BGSAVE running right on service start
This fixes another flaw with the previous implementation: running BGSAVE
right when the service is started which causes unnecessary disk I/O
3 years ago
Sayan Nandan 77f4b6e7be Make BGSAVE optimistic and fix BGSAVE bugs
This commit ensures that BGSAVE is optimistic in doing what it is doing:
If BGSAVE fails once, it will immediately poison the table. Now let's
say that some amazing sysadmin managed to SSH into the server and was
able to fix the storage issue; BGSAVE would be able to succeed.
The current implementation was flawed: firstly it prevented that and
secondly even if it succeeded in running BGSAVE, the server would refuse
to accept writes. This commit fixes this behavior.
3 years ago
Sayan Nandan a61ab02cd9
Fix disk storage on termination (#151)
See #150 for more information
3 years ago
Sayan Nandan 3616793554 Update versioning and support information [skip ci] 3 years ago
Sayan Nandan 8d3d878b81 Build binary before attempting to run it
The background process may or may not complete before the testing begins
3 years ago
Sayan Nandan 246b974bd6
Merge pull request #147 from skytable/skyhash
Implement, stabilize and migrate to Skyhash
3 years ago
Sayan Nandan 34134aa29b Fix using old binary for testing on Windows 3 years ago
Sayan Nandan 53a0082890 Make sure skyd is killed after testing on Windows 3 years ago
Sayan Nandan 6b47279b1b Fix CI script and improve terminal artwork 3 years ago
Sayan Nandan bb4637c1e3 Fix string arguments in sky-bench 3 years ago
Sayan Nandan 5847cf1da9 Upgrade sky-bench to use client driver 3 years ago
Sayan Nandan f55fa85174 Upgrade server to use client driver's `RespCode`s 3 years ago
Sayan Nandan 870c6f560d Upgrade CLI to use the client driver 3 years ago
Sayan Nandan 57d2883218 Fix SSET not skipping action name 3 years ago
Sayan Nandan d9bd911768 Fix segfault due to not skipping the action name
All the strong actions operate on the raw vector of args and hence need
to skip the action name (which is the first argument just like shell
commands)
3 years ago
Sayan Nandan 75f46c9235 Fix DBSIZE writing header when already written 3 years ago
Sayan Nandan 758baf1eb8 Use single thread for tests (drone) [skip ci] 3 years ago
Sayan Nandan ba0a67a179 Fix queries returning full responses
They should return groups instead
3 years ago
Sayan Nandan 57bfeab4fa Fix testing on M1 [skip ci] 3 years ago
Sayan Nandan 229a424f45 Fix mset and uset tests 3 years ago
Sayan Nandan bcca83c7ff Use single thread for all tests 3 years ago
Sayan Nandan 5d617eae84 Start the database server before running the tests 3 years ago
Sayan Nandan 80fc9e5e9c Upgrade all tests to use the driver 3 years ago
Sayan Nandan e08cffd187 Fix MGET returning flat array
MGET returns a 'mixed outcome' with respcodes and strings
3 years ago
Sayan Nandan db68453eab MGET returns a flat array 3 years ago
Sayan Nandan 35755f8033 Fix ret of parse error instead of `NotEnough`
If we couldn't fetch the tsymbol, it means that the stream hasn't
buffered enough data.

Also tests were added to account for the same
3 years ago
Sayan Nandan 8bdf5f32de Use write_all to ensure all bytes are written 3 years ago
Sayan Nandan b523103e4f Remove dbg messages and fix queryengine lcase eval 3 years ago
Sayan Nandan 124caec193 Disable dead_code lint for 'prospective' modules 3 years ago
Sayan Nandan a730511a2f Remove redundant methods 3 years ago
Sayan Nandan 7b11047bfe Make sure result is used 3 years ago
Sayan Nandan 78067d15eb Upgrade all interfaces to use the Skyhash protocol 3 years ago
Sayan Nandan d6a3cc2acb Document the Skyhash deserializer 3 years ago
Sayan Nandan 6d1d5f7877 Fix metaframe parsing and add more tests 3 years ago
Sayan Nandan fc5c943693 Simplify ASCII digit conversion
checked_sub is too sophisticated to use for this; just check if it is an
ASCII digit by using the built-in method
3 years ago
Sayan Nandan 4eabd3fc26 Ensure there are bytes before doing anything 3 years ago
Sayan Nandan 00dbeceb1b Remove the size part of the metaline completely
The size part of the metaline is absolutely redundant as we're doing
double the work while reading the size and then the real thing.
Since sizes won't have escape codes, we can freely read upto the LF
3 years ago
Sayan Nandan a39d9bf4cf Implement parser for new protocol 3 years ago
Sayan Nandan 14bfe1fcd1 Add support for parsing arrays and nested arrays 3 years ago
Sayan Nandan 53cad270fc Add parsing for u64 and also check overflows 3 years ago