464 Commits (bd9649ed052910a86b47b0bcac30cf8160d0c565)
 

Author SHA1 Message Date
Sayan Nandan bd9649ed05
Update CODEOWNERS 3 years ago
Sayan Nandan f379807365 Disable high port blocking 3 years ago
Sayan Nandan 07dd884f3c Upgrade deps and remove unused regex in cli
Closes #128, closes #129 and closes #132
3 years ago
Sayan Nandan db23c14570 Fix gitter and discord links 3 years ago
Sayan Nandan 4354bfc0f9 Fix ECONNRESET errors on Windows
As discussed in #110, this commit suppresses ECONNRESET on Windows.
3 years ago
Sayan Nandan ea1381269b Don't use filename `con`
Windows is the most ingenious OS in the world where filenames can
conflict with shell commands. That's right, con is an I/O device on
Windows and cannot be used for a filename! This is why we were having
checkout errors on Windows!

Vive la POSIX!
3 years ago
Sayan Nandan d3a612e815 Terminate con when exit or ctrl_c sig is received 3 years ago
Sayan Nandan cfc23d69d9 Close connection on receiving ctrl_c 3 years ago
Sayan Nandan 86fe99a1c4
Merge pull request #131 from skytable:generic-con
Implement generic connections
3 years ago
Sayan Nandan e918dabf26 Use generic Connection replacing SSL/TCP variants
We have introduced a trait `BufferedSocketStream` that is a 'dummy'
trait and is implemented for both `SslStream<TcpStream>` and
`TcpStream`. So, the generic `Connection` object accepts any type that
implements the `BufferedSocketStream` trait (and hence should also
implement `AsyncWrite`)
3 years ago
Sayan Nandan 4ba5418120 Document `dbnet::con` 3 years ago
Sayan Nandan ef36351428 Refactor dbnet and protocol into logical modules 3 years ago
Sayan Nandan eb71335a62 Upgrade all functions to use generic connections
This commit does a LOT! It migrates the `queryengine::execute_simple`,
`CoreDB::execute_query` and the kvengine functions to use generic
connections.

The object dbnet::Con was removed because it isn't needed anymore.
The listeners were also upgraded to use the generic connection handler
3 years ago
Sayan Nandan c399ae1f1c Implement a generic con handler and rename traits
The trait `Con` and `ConOps` were renamed to `ProtocolConnectionExt`
and `ProtocolConnection`.

This naming scheme clearly explains that the Ext version 'augments' the
non-Ext impl. This is the very case here: ProtocolConnection provides
the basic funtions needed for interfacing with net I/O while the Ext
trait enables high-level interaction with the protocol and ultimately
queries.

A generic `ConnectionHandler` object was added that will replace the
SSL and non-SSL handler objects, again reducing redundancy.

Dummy execute functions were added to CoreDB and queryengine.
3 years ago
Sayan Nandan ba478b9f5a Add a generic implementation for a connection
This commit defines two traits: `Con` and `ConOps`. Implementors of
`ConOps` get a free implementation for `Con`. `Con` is the ultimate
object that can be used in place of the current SSL/non-SSL connection
objects. If you look at the implementations of the current connection
objects, they have a lot of repetition as they do almost the same thing
except for the fact that they have a different underlying stream.
This is exactly what we're trying to eliminate. We will also define a
generic connection handler object to reduce redundancy.
3 years ago
Sayan Nandan 7dadf4411f Persist artifacts across runs 3 years ago
Sayan Nandan 70d049e3f0 Enable rustup toolchain updates 3 years ago
Sayan Nandan 337ffbda81 Add testing for aarch64-apple-darwin 3 years ago
Sayan Nandan 9e11b8bcd0 Add note on how `dbtest` tests work 3 years ago
Sayan Nandan ee623586f9 Exclude port ranges reserved/blocked by Hyper-V
This commit removes the port ranges blocked/reserved by Windows on
Hyper-V VMs from the random port allocation range; see the comment for
more information.
3 years ago
Sayan Nandan 5f40e1538b Use IANA's dyn port range for setting random port 3 years ago
Sayan Nandan f151927f8a Add crt-static to RUSTFLAGS for Windows 3 years ago
Sayan Nandan 70ca5c143c Enable artifact generation on every commit 3 years ago
Sayan Nandan 7fb44e79c7
Merge 'flock' into next
Add native file locking
3 years ago
Sayan Nandan 2cbd35cbb5 Enable flocks on startup and shutdown
Several changes were made to accomodate for this, including the addition
of the write_to_disk function that should be used by fns which don't
have a FileLock to pass for flushing data to the disk.

BGSAVE now takes ownership of a FileLock object which it uses for
running BGSAVE.
3 years ago
Sayan Nandan fd23218809 Add test for Windows for duplicate unlock attempts 3 years ago
Sayan Nandan 02e57f5da0 Document `flock`s 3 years ago
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>
3 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