891 Commits (d0ee66ac4c5a71bab43b183c8bb47401fabf10a7)
 

Author SHA1 Message Date
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
Sayan Nandan d9af302417 Don't use additional scope 3 years ago
Sayan Nandan fb503e2981 Fix trying to unlock `file` instead of `file2`
Silly me, `file` has already been unlocked
3 years ago
Sayan Nandan 1180de3b71 Ret FileLock from BGSave to unlock before flush_db 3 years ago
Sayan Nandan 5df31287da Use dedicated blocking osthread for unlocking file
This commit ensures that the file unlock operation is completed as soon
as bgsave returns and not in the future
3 years ago
Sayan Nandan 39ab1e7683 Log error that causes `flush_db` to fail 3 years ago
Sayan Nandan 3407f1e971 Change wd to artifacts to package bundle 3 years ago
Sayan Nandan 44e88518cf Fix artifact packaging
The upload-release-asset action only supports files and not entire dirs.
I had expected it to zip an item if it were a directory; but I was wrong
This commit zips everything before attempting to upload the artifacts
3 years ago
Sayan Nandan 16a19106cb Fix release script to hardcode artifact names
GHA doesn't support using env for matrix.include vars
3 years ago
Sayan Nandan 99826b8b02
Add release script for 32-bit targets (#138) 3 years ago
Sayan Nandan ec74b8118e Fix link [ci skip] 3 years ago
Sayan Nandan 0673192d51
Auto parse input from netsh to find reserved ports (#137)
This commit attempts to fix testing on Windows. It does this by parsing
output from `netsh interface ipv4 show excludedportrange protocol=tcp`
to find the port ranges that were reserved by this specifc Windows host
and then adds these ports to the set of already used ports (`in_set`) to
avoid allocating them to a test function.
3 years ago
Sayan Nandan 379660f14c
Add testing for new Tier 1 targets (#135)
* Add support for new T1 platforms

This commit adds support for the following Tier-1 (T1) platforms:
- i686-unknown-linux-gnu
- i686-pc-windows-msvc

* Fix channel and add explicit target in cargo test

* Use `target add` to add $matrix.rust target

* Use actions-rs/toolchain to install rust

* Install musl-tools to test musl

* Simplify matrix

* Add 32-bit targets and refactor workflow

* Fix build matrix

* Explicitly specify target in cargo test

* Use rustup to install toolchain

* Install 32 bit tools on Linux

* Remove ports in [49000,50000] on Windows
3 years ago
Sayan Nandan a2d98c2bcb
Revert "Create Dependabot config file (#27)" (#134)
This reverts commit c4f00de5b5.
3 years ago
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