Compare commits
12 Commits
next
...
scylla-0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e3b98f281 | ||
|
|
124489e8d8 | ||
|
|
7a2c57d6bd | ||
|
|
10543bf81e | ||
|
|
579a220162 | ||
|
|
8c5ffb84ce | ||
|
|
d05cdb0f6e | ||
|
|
df02fb7a3e | ||
|
|
559a8b41f2 | ||
|
|
8b1f18ee1a | ||
|
|
cbbd18a249 | ||
|
|
4db985e505 |
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=666.development
|
||||
VERSION=0.19
|
||||
|
||||
if test -f version
|
||||
then
|
||||
|
||||
@@ -338,13 +338,8 @@ lists::do_append(shared_ptr<term> t,
|
||||
if (!value) {
|
||||
m.set_cell(prefix, column, params.make_dead_cell());
|
||||
} else {
|
||||
auto&& to_add = list_value->_elements;
|
||||
auto deref = [] (const bytes_opt& v) { return *v; };
|
||||
auto&& newv = collection_mutation{list_type_impl::pack(
|
||||
boost::make_transform_iterator(to_add.begin(), deref),
|
||||
boost::make_transform_iterator(to_add.end(), deref),
|
||||
to_add.size(), cql_serialization_format::internal())};
|
||||
m.set_cell(prefix, column, atomic_cell_or_collection::from_collection_mutation(std::move(newv)));
|
||||
auto newv = list_value->get_with_protocol_version(cql_serialization_format::internal());
|
||||
m.set_cell(prefix, column, params.make_cell(std::move(newv)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
dist/ami/files/scylla-ami
vendored
2
dist/ami/files/scylla-ami
vendored
Submodule dist/ami/files/scylla-ami updated: d4a0e18637...84bcd0df6d
14
dist/common/scripts/scylla_io_setup
vendored
14
dist/common/scripts/scylla_io_setup
vendored
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
#!/bin/sh
|
||||
|
||||
is_ami() {
|
||||
if [ "`dmidecode --string system-version | grep \.amazon`" != "" ] && \
|
||||
@@ -18,12 +18,6 @@ is_supported_instance_type() {
|
||||
}
|
||||
|
||||
is_developer_mode() {
|
||||
. /etc/os-release
|
||||
if [ "$NAME" = "Ubuntu" ]; then
|
||||
. /etc/default/scylla-server
|
||||
else
|
||||
. /etc/sysconfig/scylla-server
|
||||
fi
|
||||
echo $SCYLLA_ARGS|egrep -c "\-\-developer-mode(\s+|=)1"
|
||||
}
|
||||
|
||||
@@ -50,6 +44,12 @@ if [ ! -f /etc/scylla/io_configured ] && [ `is_developer_mode` -eq 0 ]; then
|
||||
echo "SCYLLA_IO=\"--num-io-queues $NR_IO_QUEUES --max-io-requests $NR_REQS\"" > /etc/scylla.d/io.conf
|
||||
else
|
||||
iotune --evaluation-directory /var/lib/scylla --format envfile --options-file /etc/scylla.d/io.conf
|
||||
if [ $? -ne 0 ]; then
|
||||
logger -p user.err "/var/lib/scylla did not pass validation tests, it may not be on XFS and/or has limited disk space."
|
||||
logger -p user.err "This is a non-supported setup, and performance is expected to be very bad."
|
||||
logger -p user.err "For better performance, placing your data on XFS-formatted directories is required."
|
||||
logger -p user.err " To override this error, see the developer_mode configuration option."
|
||||
fi
|
||||
fi
|
||||
touch /etc/scylla/io_configured
|
||||
fi
|
||||
|
||||
2
dist/common/scripts/scylla_prepare
vendored
2
dist/common/scripts/scylla_prepare
vendored
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if [ -f /etc/scylla/ami_disabled ]; then
|
||||
if [ "$AMI" = "yes" ] && [ -f /etc/scylla/ami_disabled ]; then
|
||||
rm /etc/scylla/ami_disabled
|
||||
exit 1
|
||||
fi
|
||||
|
||||
6
dist/common/scripts/scylla_sysconfig_setup
vendored
6
dist/common/scripts/scylla_sysconfig_setup
vendored
@@ -12,6 +12,7 @@ print_usage() {
|
||||
echo " --homedir scylla home directory"
|
||||
echo " --confdir scylla config directory"
|
||||
echo " --setup-nic setup NIC's interrupts, RPS, XPS"
|
||||
echo " --ami AMI instance mode"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -60,6 +61,10 @@ while [ $# -gt 0 ]; do
|
||||
SETUP_NIC=1
|
||||
shift 1
|
||||
;;
|
||||
"--ami")
|
||||
AMI=yes
|
||||
shift 1
|
||||
;;
|
||||
*)
|
||||
print_usage
|
||||
;;
|
||||
@@ -86,5 +91,6 @@ sed -e s#^NETWORK_MODE=.*#NETWORK_MODE=$NETWORK_MODE# \
|
||||
-e s#^SCYLLA_CONF=.*#SCYLLA_CONF=$SCYLLA_CONF# \
|
||||
-e s#^SET_NIC=.*#SET_NIC=$SET_NIC# \
|
||||
-e "s#^SCYLLA_ARGS=.*#SCYLLA_ARGS=\"$SCYLLA_ARGS\"#" \
|
||||
-e s#^AMI=.*#AMI=$AMI# \
|
||||
$SYSCONFIG/scylla-server > /tmp/scylla-server
|
||||
mv /tmp/scylla-server $SYSCONFIG/scylla-server
|
||||
|
||||
4
dist/common/sysconfig/scylla-server
vendored
4
dist/common/sysconfig/scylla-server
vendored
@@ -40,5 +40,5 @@ SCYLLA_ARGS="--log-to-syslog 1 --log-to-stdout 0 --default-log-level info --coll
|
||||
## scylla arguments (for dpdk mode)
|
||||
#SCYLLA_ARGS="--log-to-syslog 1 --log-to-stdout 0 --default-log-level info --collectd-address=127.0.0.1:25826 --collectd=1 --collectd-poll-period 3000 --network-stack native --dpdk-pmd"
|
||||
|
||||
# scylla IO parameters (max-io-requests and max-io-queues) are automatically
|
||||
# configured, saved at /etc/scylla.d/io.conf
|
||||
# setup as AMI instance
|
||||
AMI=no
|
||||
|
||||
1
dist/redhat/systemd/scylla-io-setup.service
vendored
1
dist/redhat/systemd/scylla-io-setup.service
vendored
@@ -4,6 +4,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/scylla-server
|
||||
ExecStart=/usr/lib/scylla/scylla_io_setup
|
||||
RemainAfterExit=yes
|
||||
TimeoutStartSec=1800
|
||||
|
||||
4
dist/ubuntu/debian/scylla-server.init
vendored
4
dist/ubuntu/debian/scylla-server.init
vendored
@@ -29,8 +29,8 @@ SCRIPTNAME=/etc/init.d/$NAME
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/default/scylla-server|sed -e 's/^/export /'`"
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/scylla.d/*.conf|sed -e 's/^/export /'`"
|
||||
|
||||
# Define LSB log_* functions.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
12
dist/ubuntu/debian/scylla-server.upstart
vendored
12
dist/ubuntu/debian/scylla-server.upstart
vendored
@@ -25,20 +25,20 @@ chdir /var/lib/scylla
|
||||
env HOME=/var/lib/scylla
|
||||
|
||||
pre-start script
|
||||
. /etc/default/scylla-server
|
||||
export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS SCYLLA_IO
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/default/scylla-server|sed -e 's/^/export /'`"
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/scylla.d/*.conf|sed -e 's/^/export /'`"
|
||||
sudo /usr/lib/scylla/scylla_prepare
|
||||
sudo /usr/lib/scylla/scylla_io_setup
|
||||
end script
|
||||
|
||||
script
|
||||
. /etc/default/scylla-server
|
||||
export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS SCYLLA_IO
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/default/scylla-server|sed -e 's/^/export /'`"
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/scylla.d/*.conf|sed -e 's/^/export /'`"
|
||||
exec /usr/bin/scylla $SCYLLA_ARGS $SCYLLA_IO
|
||||
end script
|
||||
|
||||
post-stop script
|
||||
. /etc/default/scylla-server
|
||||
export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS SCYLLA_IO
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/default/scylla-server|sed -e 's/^/export /'`"
|
||||
eval "`grep -v -e "^\s*#" -e "^$" /etc/scylla.d/*.conf|sed -e 's/^/export /'`"
|
||||
sudo /usr/lib/scylla/scylla_stop
|
||||
end script
|
||||
|
||||
4
dist/ubuntu/rules.in
vendored
4
dist/ubuntu/rules.in
vendored
@@ -8,6 +8,7 @@ SYSCTL = $(CURDIR)/debian/scylla-server/etc/sysctl.d
|
||||
SUDOERS = $(CURDIR)/debian/scylla-server/etc/sudoers.d
|
||||
LIMITS= $(CURDIR)/debian/scylla-server/etc/security/limits.d
|
||||
COLLECTD= $(CURDIR)/debian/scylla-server/etc/collectd/collectd.conf.d
|
||||
SCYLLAD= $(CURDIR)/debian/scylla-server/etc/scylla.d
|
||||
LIBS = $(CURDIR)/debian/scylla-server/usr/lib
|
||||
CONF = $(CURDIR)/debian/scylla-server/etc/scylla
|
||||
|
||||
@@ -33,6 +34,9 @@ override_dh_auto_install:
|
||||
mkdir -p $(COLLECTD) && \
|
||||
cp $(CURDIR)/dist/common/collectd.d/scylla.conf $(COLLECTD)
|
||||
|
||||
mkdir -p $(SCYLLAD) && \
|
||||
cp $(CURDIR)/dist/common/scylla.d/io.conf $(SCYLLAD)
|
||||
|
||||
mkdir -p $(CONF) && \
|
||||
cp $(CURDIR)/conf/scylla.yaml $(CONF)
|
||||
cp $(CURDIR)/conf/cassandra-rackdc.properties $(CONF)
|
||||
|
||||
2
log.cc
2
log.cc
@@ -100,7 +100,7 @@ logger::really_do_log(log_level level, const char* fmt, stringer** s, size_t n)
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count() % 1000;
|
||||
auto tm = std::chrono::system_clock::to_time_t(now);
|
||||
char tmp[100];
|
||||
strftime(tmp, sizeof(tmp), "%Y-%m-%d %T", std::localtime(&tm));
|
||||
strftime(tmp, sizeof(tmp), " %Y-%m-%d %T", std::localtime(&tm));
|
||||
out << tmp << sprint(",%03d", residual_millis);
|
||||
syslog_offset += 24;
|
||||
}
|
||||
|
||||
@@ -205,12 +205,20 @@ class datacenter_write_response_handler : public abstract_write_response_handler
|
||||
}
|
||||
}
|
||||
public:
|
||||
using abstract_write_response_handler::abstract_write_response_handler;
|
||||
datacenter_write_response_handler(shared_ptr<storage_proxy> p, keyspace& ks, db::consistency_level cl, db::write_type type,
|
||||
schema_ptr s, lw_shared_ptr<const frozen_mutation> mutation, std::unordered_set<gms::inet_address> targets,
|
||||
std::vector<gms::inet_address> pending_endpoints, std::vector<gms::inet_address> dead_endpoints) :
|
||||
abstract_write_response_handler(std::move(p), ks, cl, type, std::move(s), std::move(mutation),
|
||||
std::move(targets), boost::range::count_if(pending_endpoints, db::is_local), std::move(dead_endpoints)) {}
|
||||
};
|
||||
|
||||
class write_response_handler : public abstract_write_response_handler {
|
||||
public:
|
||||
using abstract_write_response_handler::abstract_write_response_handler;
|
||||
write_response_handler(shared_ptr<storage_proxy> p, keyspace& ks, db::consistency_level cl, db::write_type type,
|
||||
schema_ptr s, lw_shared_ptr<const frozen_mutation> mutation, std::unordered_set<gms::inet_address> targets,
|
||||
std::vector<gms::inet_address> pending_endpoints, std::vector<gms::inet_address> dead_endpoints) :
|
||||
abstract_write_response_handler(std::move(p), ks, cl, type, std::move(s), std::move(mutation),
|
||||
std::move(targets), pending_endpoints.size(), std::move(dead_endpoints)) {}
|
||||
};
|
||||
|
||||
class datacenter_sync_write_response_handler : public abstract_write_response_handler {
|
||||
@@ -228,16 +236,20 @@ class datacenter_sync_write_response_handler : public abstract_write_response_ha
|
||||
public:
|
||||
datacenter_sync_write_response_handler(shared_ptr<storage_proxy> p, keyspace& ks, db::consistency_level cl, db::write_type type,
|
||||
schema_ptr s,
|
||||
lw_shared_ptr<const frozen_mutation> mutation, std::unordered_set<gms::inet_address> targets, size_t pending_endpoints,
|
||||
lw_shared_ptr<const frozen_mutation> mutation, std::unordered_set<gms::inet_address> targets, std::vector<gms::inet_address> pending_endpoints,
|
||||
std::vector<gms::inet_address> dead_endpoints) :
|
||||
abstract_write_response_handler(std::move(p), ks, cl, type, std::move(s), std::move(mutation), targets, pending_endpoints, dead_endpoints) {
|
||||
abstract_write_response_handler(std::move(p), ks, cl, type, std::move(s), std::move(mutation), targets, 0, dead_endpoints) {
|
||||
auto& snitch_ptr = locator::i_endpoint_snitch::get_local_snitch_ptr();
|
||||
|
||||
for (auto& target : targets) {
|
||||
auto dc = snitch_ptr->get_datacenter(target);
|
||||
|
||||
if (_dc_responses.find(dc) == _dc_responses.end()) {
|
||||
_dc_responses.emplace(dc, db::local_quorum_for(ks, dc));
|
||||
auto pending_for_dc = boost::range::count_if(pending_endpoints, [&snitch_ptr, &dc] (gms::inet_address& ep){
|
||||
return snitch_ptr->get_datacenter(ep) == dc;
|
||||
});
|
||||
_dc_responses.emplace(dc, db::local_quorum_for(ks, dc) + pending_for_dc).first;
|
||||
_pending_endpoints += pending_for_dc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,17 +328,15 @@ storage_proxy::response_id_type storage_proxy::create_write_response_handler(sch
|
||||
{
|
||||
std::unique_ptr<abstract_write_response_handler> h;
|
||||
auto& rs = ks.get_replication_strategy();
|
||||
size_t pending_count = pending_endpoints.size();
|
||||
|
||||
auto m = make_lw_shared<const frozen_mutation>(std::move(mutation));
|
||||
|
||||
if (db::is_datacenter_local(cl)) {
|
||||
pending_count = std::count_if(pending_endpoints.begin(), pending_endpoints.end(), db::is_local);
|
||||
h = std::make_unique<datacenter_write_response_handler>(shared_from_this(), ks, cl, type, std::move(s), std::move(m), std::move(targets), pending_count, std::move(dead_endpoints));
|
||||
h = std::make_unique<datacenter_write_response_handler>(shared_from_this(), ks, cl, type, std::move(s), std::move(m), std::move(targets), std::move(pending_endpoints), std::move(dead_endpoints));
|
||||
} else if (cl == db::consistency_level::EACH_QUORUM && rs.get_type() == locator::replication_strategy_type::network_topology){
|
||||
h = std::make_unique<datacenter_sync_write_response_handler>(shared_from_this(), ks, cl, type, std::move(s), std::move(m), std::move(targets), pending_count, std::move(dead_endpoints));
|
||||
h = std::make_unique<datacenter_sync_write_response_handler>(shared_from_this(), ks, cl, type, std::move(s), std::move(m), std::move(targets), std::move(pending_endpoints), std::move(dead_endpoints));
|
||||
} else {
|
||||
h = std::make_unique<write_response_handler>(shared_from_this(), ks, cl, type, std::move(s), std::move(m), std::move(targets), pending_count, std::move(dead_endpoints));
|
||||
h = std::make_unique<write_response_handler>(shared_from_this(), ks, cl, type, std::move(s), std::move(m), std::move(targets), std::move(pending_endpoints), std::move(dead_endpoints));
|
||||
}
|
||||
return register_response_handler(std::move(h));
|
||||
}
|
||||
|
||||
@@ -1214,6 +1214,7 @@ public:
|
||||
if (_active) {
|
||||
assert(_active->is_empty());
|
||||
free_segment(_active);
|
||||
_active = nullptr;
|
||||
}
|
||||
if (_group) {
|
||||
_group->del(this);
|
||||
|
||||
Reference in New Issue
Block a user