527 Commits (d6a3cc2acb30374aef96caaef52aebc2feb70e7e)
 

Author SHA1 Message Date
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
Sayan Nandan ad0fbffe32 Add data types and add parsing for strings 3 years ago
Sayan Nandan 60d7a1c173 Optimize will_cursor_give_char check 3 years ago
Sayan Nandan 3a1abda2cb Return NotEnough if nothing at current cursor
If Parser::will_cursor_give_char is set to not error if a char matches
or the next line is empty, return Ok(bool). If this_if_nothing_ahead is
set to false, then return a NotEnough error if no more chars are
available.

The newly added test explains why
3 years ago
Sayan Nandan 6d29e519c9 Fix read_sizeline returning wrong error
Also added more tests
3 years ago
Sayan Nandan daaf6968ba Verify if byte is LF before moving cursor 3 years ago
Sayan Nandan d91e696e24 Add more tests 3 years ago
Sayan Nandan 0bdbd81f92 Add a header magic
We add a header magic '0x0D' or the CR byte. This acts as a boundary
between multiple queries on the same connection
3 years ago
Sayan Nandan 88b4eb88a1 Make some idents public 3 years ago
Sayan Nandan 6dbe0fcfaa Add parsing for complete query 3 years ago
Sayan Nandan e07614d857 Rename function to reflect names in rest of mod 3 years ago
Sayan Nandan d22fec8036 Implement complete actiongroup parsing 3 years ago
Sayan Nandan 65f0e445a4 Pre-allocate capacity for the element 3 years ago
Sayan Nandan 2efe2ab213 Implement parsing of datagroup elements 3 years ago
Sayan Nandan 14e0ab2462 Rename functions appropriately 3 years ago
Sayan Nandan 773c82ac83 Add actiongroup size parsing 3 years ago
Sayan Nandan 2fed0e876b Implement metaframe parsing 3 years ago
Sayan Nandan 559af81ee9 Start impl of new parser and add sizeline parsing 3 years ago
Sayan Nandan 4265820fbd Don't raise error if there is more data 3 years ago
Sayan Nandan c9b2abfc96 Fix test 3 years ago
Sayan Nandan abb1b9bf33 Only discard part of buffer that was parsed 3 years ago
Sayan Nandan 74893c275e
Abstract HashMap into HTable (#146)
It is likely that we'll change the HashMap implementation in the future,
hence its best to hide away the HashMap to make sure we can easily
replace it.
3 years ago
Sayan Nandan 6ab73958f2 Fix release script
We accidentally tried to build linux-gnu (x86_64) on Windows!
3 years ago
Sayan Nandan fea67a9900 Add note on musl 3 years ago
Sayan Nandan 3699cc4720
Add support for MUSL x86_64 and fix CI scripts (#145) 3 years ago
Sayan Nandan d18631680c Bump up version and add changelog entry 3 years ago
Sayan Nandan 63708d58f4 Fix release script 3 years ago
Sayan Nandan 50273f324a Upgrade dependencies 3 years ago
Sayan Nandan 874ccf3c52
Merge pull request #144 from skytable/datadir
Change the data storage directory structure
3 years ago
Sayan Nandan f3e7a73b00 Fix trying to read dir instead of snapshot file
Also, migration support for the old snapshot directory was added
3 years ago
Sayan Nandan 90ee7baa8a Fix snapshot directory parsing logic
The previous logic was heavily flawed; it only had to check if the path
was a dir and isn't the remote snapshot directory.

Similarly, the file name parsing should only kick in if the item is a
file
3 years ago
Sayan Nandan 772e7b0b27 Fix restoring from snapshot and data file 3 years ago
Sayan Nandan 0b3dd9c129 Add backwards compat for old snapshot dirs 3 years ago
Sayan Nandan f013a90179 Change snapshot directory to data/snapshots 3 years ago
Sayan Nandan f60b3098da Change the data file path to data/data.bin
As a consequence, other methods were also upgraded
3 years ago
Sayan Nandan b0bcc9bfa7 Add link to driver 3 years ago
Sayan Nandan 3851f6d9ce
Remove redundant functions from mod `config` (#143) 3 years ago
Sayan Nandan f1beb7b1e3
Add support for line editing, history and keyboard shortcuts in skysh (#142)
* Add line editing and history support

* Enable screen to be cleared by running clear
3 years ago
Sayan Nandan 885e2f2c42
Merge pull request #141 from skytable/fixflock
Fix file locking on Windows (and across platforms)
3 years ago
Sayan Nandan ce466ebc22 Reacquire lock when runtime exits
This commit adds changes so that the main process almost immediately
acquires a lock on the data file when runtime is dropped. This is just
an added precaution to try and ensure that no other process does
something silly with the data file.

The descriptor is cloned for this using `FileLock::try_clone`
3 years ago
Sayan Nandan 74ce75d919 There is no need for block_on_process_exit
8e46e62 added a block_on_process_exit function that kept on sending
`notify_one()`s in a loop until the services terminated. This was
pointless as the `Drop` impl would do it for us anyways.
(What was I thinking?)

So, in main(), we're spawning an async task that lets the DB run as long
as we don't pass a ctrl_c (or some bad panic occurs). Once the ctrl_c
is received, we start terminating all workers. `block_on` returns DB
which should be the only one holding an atomic reference to the shared
field. We assert this right after dropping `runtime`.

Finally, the ECONNRESET suppression match was fixed to remove an
unreachable branch by adding conditional compilation
3 years ago
Sayan Nandan 8e46e62d3f Wait for all workers to drop and release flock(s)
This commit ensures that the workers exit before attempting a flush_db
operation. Only after block_on_process_exit finishes we return `db`.
Now we run a simple flush_db operation knowing that the lock has been
released.
To block on process termination, we introduce a new function
block_on_process_exit that does the same thing as CoreDB's Drop
implementation.
3 years ago
Sayan Nandan 7349f5261d Manually build rt and then block on dbnet::run 3 years ago