537 Commits (80fc9e5e9c9b5cd5755b1083a959851963a659d6)
 

Author SHA1 Message Date
Sayan Nandan 982b8e9a25 Use the unlocked field across all platforms
Initially added in 7777d1ee, this commit enables it for all platforms to
avoid an extra syscall
3 years ago
Sayan Nandan 7777d1ee96 Attempt to fix flocks on windows with unlock field
It seems that on Windows unlocking errors if the file has already been
unlocked. To fix this, we've added a platform-specific field to see if
the FileLock object has already been used to unlock the file.
This is the unlock field. In the Drop impl for Windows, we check the
unlocked flag to determine if we need to unlock the file.
3 years ago
Sayan Nandan 79a7cfd2c2 windows::um::fileapi::UnlockFile is an unsafe call 3 years ago
Sayan Nandan 8e45ef2427 Add test for flock that fails if lock is active 3 years ago
Sayan Nandan 46188f88db Fix missing import on Windows
As the linter doesn't show errors on non-Windows for the cfg(windows)
module, I happened to miss the std::fs::File import.
3 years ago
Sayan Nandan 6e680b33e5 Add native file locks for unix and windows systems
This commit implements file locks for unix-based systems and windows
systems. This is done by using platform-specific `__sys` modules for
locking, trying to lock and unlocking files.

A build script was added for unix-systems that make use of the
flock-posix.c file
3 years ago
Sayan Nandan aca9888109 Remove fscposix and begin adding native impls
This commit removes the fscposix.c file and begins implementing native
file locking mechanisms for each platform (supported platforms)

BSD-style `flock`s were added
3 years ago
Sayan Nandan bfb74200ec Use CoreDB::new_empty() instead of new for brevity 3 years ago
Sayan Nandan 8e41cab99a Re-compile fscposix.c if it changes 3 years ago
Sayan Nandan 2d7a03d279 Add basic test for file locks (POSIX) 3 years ago
Sayan Nandan bb9d98d63e Panic explicitly in the Drop impl if unlock fails
Also, the documentation was updated
3 years ago
Sayan Nandan 83911af208 Only run build.rs for fscposix.c on unix systems 3 years ago
Sayan Nandan a9710587bb Add advisory locking for POSIX systems
This commit adds a basic implementation of POSIX advisory record locking
which sets a lock on the `data.bin` file when the database server starts
and releases the lock when it terminates. This is just done for
compliance to let other processes know that we don't want them to use
the file.

However, the result depends entirely on the process that wants to do
'something' with the file. It is the responsibility of the process to
ensure that it respects the file lock.

Also, exclusive locks aren't perfect on Linux, so we can't rely on them.
See discussion #123 for more information.
3 years ago
Sayan Nandan 1be348f5a2 Upgrade deps
Closes #117, closes #118 and closes #121
3 years ago
Sayan Nandan 6601b97df4
Merge 'bench-levity.1' into next (#120)
Make sky-bench less aggressive
3 years ago
Sayan Nandan 6710e90e40 Optimize sanity test implementation
Also, sanity tests for GET, SET and DEL were added and the error
handling was optimized along with some code formatting
3 years ago
Sayan Nandan c6d5746669
Remove the ICLA (#122)
We use FSFE's CLA and hence this is no longer relevant
3 years ago
Sayan Nandan 63876b4c5c Make sky-bench less aggressive
Instead of unwrapping furiously right away, this commit makes sky-bench
first run a ping test (HEYA) to check if everything is all right.
If that is the case indeed, then we continue to run the benches, else
we terminate the program.

This has been discussed in #119
3 years ago
Sayan Nandan 6a5163db6a Fix element length in pre-compiled resp data group
This fixes the element length for the MKSNAP disabled error
3 years ago
Sayan Nandan 5c0fdde44c
Make responses returned by `MKSNAP` static
This will avoid runtime generation of responses after the first `Deref`.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
3 years ago
Sayan Nandan d815793246
Bump syn from 1.0.68 to 1.0.69 (#116)
Closes #116

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 32f76e3964
Update usage of `add-path` to use $GITHUB_PATH
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 9543ac3a1e
Use GNU tar instead of BSD tar for macOS caching
The discussion from #115 should explain a few things

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 740ba03ecc
Upgrade deps and remove caching on macOS again
Closes #113 and closes #114

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan a9f3d082b9
Restore caching on macOS runners
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 507215379f
Rem usize field in ParseResult::BadPacket variant
This variant is absolutely redundant as we're just ignoring the entire
buffer and not just a part of it

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan e10cc1411f
Upgrade deps and fix actiondoc script
Closes #111 and closes #112

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 28f0666914
Fix actiondoc and update doc builder script
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan e31c08dbb0
Fix outdated comments and ident naming
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 8808ab957d
Fix .dockerignore to include `skyd`
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 9df39187d1
Upgrade deps, add changelog entry and bump version
This closes #107, closes #108 and closes #109.

The configuration template was updated to include TLS/SSL and the
corresponding tests were also updated.

It also renames `sdb` to `skyd` for streamlining binary names.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 03f97d4ac8
Optimize some functions to reduce verbosity
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan d7fbf0e10e
Perl setup is no longer required
As per the runner docs Perl is already installed on the runners.
This is why explicit setup is not required.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 859614a84f
Fix release script to use `sky-bench`
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 5392f27fdd
Improve builds and fix release builds (#105)
* Checkout the PR branch if triggered by a PR

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>

* Use `cmd` as the shell on Windows to fix builds

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>

#104 did this for pushes; this will do it for releases.

* Fix Windows release script

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>

* No need to checkout to head.ref for PRs

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan ce46e318f1
Fix Windows builds by defaulting to `cmd` (#104)
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 151d2dd454
Upgrade deps
Closes #96, Closes #97, Closes #98, Closes #101, Closes #102
and Closes #103.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 5d98b3522e
Enable string escaping with quotes for skysh
This commit uses a Regex match iterator along with a few replace
operations to enable the parsing of quoted strings from arguments.

Previously, we simply ran a `split_whitespace()` to get the parts of the
ActionGroup, but now we're using this new Regex which enables arguments
like: 'SET me "sayan spaced"' to be passed and validated.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan e051a0376b
Improve `gen_match!` macro to use path matches
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 65681f38bb
Use `gen_match!` macro to simplify function calls
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 43779eb08e
And now we're Skytable
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 339844a613
Merge branch 'hotfix.1' into next
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 6a10f927c8
Upgrade deps
Closes #88, closes #89

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 56b958a9cf
Revise copyright blocks as per OSI guidelines
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 38b011273b
Add fix and tests for VE/S/00001
This commit now checks if the second value passed to MKSNAP points
to any parent/root directory before performing any action.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 367ee86aa5
Fix docker image repo link
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan a3398f1d07
Rebrand from TerrabaseDB to Skybase (#90)
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 7bf17a6374
Move tests in tdb/config to a separate module
Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 37f2c6355d
Restore `iter.next()` call removed in 4dcb203359
This call is necessary as SUPDATE returns Nil even if one of the keys
don't exist.

Also, this was note added to the actiondoc.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago
Sayan Nandan 2c895cf143
Upgrade dependencies
This closes #86 and also closes #87.

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
4 years ago