mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 12:36:56 +00:00
c7aa73af515edbae90ac89d5dc461885b008e06f
" Recently, there has been a series of incidents of the multishard combining reader deadlocking, when the concurrency of reads were severely restricted and there was no timeout for the read. Several fixes have been merged (414b14a6b,21b4b2b9a,ee193f1ab,170fa382f) but eliminating all occurrences of deadlocks proved to be a whack-a-mole game. After the last bug report I have decided that instead of trying to plug new wholes as we find them, I'll try to make wholes impossible to appear in the first place. To translate this into the multishard reader, instead of sprinkling new `reader.pause()` calls all over the place in the multishard reader to solve the newly found deadlocks, make the pausing of readers fully automatic on the shard reader level. Readers are now always kept in a paused state, except when actually used. This eliminates the entire class of deadlock bugs. This patch-set also aims at simplifying the multishard reader code, as well as the code of the existing `lifecycle_policy` implementations. This effort resulted in: * mutation_reader.cc: no change in SLOC, although it now also contains logic that used to be duplicated in every `lifecycle_policy` implementation; * multishard_mutation_query.cc: 150 SLOC removed; * database.cc: 30 SLOC removed; Also the code is now (hopefully) simpler, safer and has a clearer structure. Fixes #4050 (main issue) Fixes #3970 Fixes #3998 (deprecates really) " * 'simplify-and-fix-multishard-reader/v3.1' of https://github.com/denesb/scylla: query_mutations_on_all_shards(): make states light-weight query_mutations_on_all_shards(): get rid of read_context::paused_reader query_mutations_on_all_shards(): merge the dismantling and ready_to_save states into saving state query_mutations_on_all_shards(): pause looked-up readers query_mutation_on_all_shards(): remove unecessary indirection shard_reader: auto pause readers after being used reader_concurrency_semaphore::inactive_read_handle: fix handle semantics shard_reader: make reader creation sync shard_reader: use semaphore directly to pause-resume shard_reader: recreate_reader(): fix empty range case foreign_reader: rip out the now unused private API shard_reader: move away from foreign_reader multishard_combining_reader: make shard_reader a shared pointer multishard_combining_reader: move the shard reader definition out multishard_combining_reader: disentangle shard_reader
…
…
…
…
Scylla
Quick-start
$ git submodule update --init --recursive
$ sudo ./install-dependencies.sh
$ ./configure.py --mode=release
$ ninja-build -j4 # Assuming 4 system threads.
$ ./build/release/scylla
$ # Rejoice!
Please see HACKING.md for detailed information on building and developing Scylla.
Note: GCC >= 8.1.1 is require to compile Scylla.
Note: See frozen toolchain for a way to build and run on an older distribution.
Running Scylla
- Run Scylla
./build/release/scylla
- run Scylla with one CPU and ./tmp as data directory
./build/release/scylla --datadir tmp --commitlog-directory tmp --smp 1
- For more run options:
./build/release/scylla --help
Building Fedora RPM
As a pre-requisite, you need to install Mock on your machine:
# Install mock:
sudo yum install mock
# Add user to the "mock" group:
usermod -a -G mock $USER && newgrp mock
Then, to build an RPM, run:
./dist/redhat/build_rpm.sh
The built RPM is stored in /var/lib/mock/<configuration>/result directory.
For example, on Fedora 21 mock reports the following:
INFO: Done(scylla-server-0.00-1.fc21.src.rpm) Config(default) 20 minutes 7 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-21-x86_64/result
Building Fedora-based Docker image
Build a Docker image with:
cd dist/docker
docker build -t <image-name> .
Run the image with:
docker run -p $(hostname -i):9042:9042 -i -t <image name>
Contributing to Scylla
Description
Languages
C++
72.3%
Python
26.5%
CMake
0.3%
GAP
0.3%
Shell
0.3%