Compare commits

...

12 Commits

Author SHA1 Message Date
Pekka Enberg
e10588e37a streaming/stream_session: Don't stop stream manager
We cannot stop the stream manager because it's accessible via the API
server during shutdown, for example, which can cause a SIGSEGV.

Spotted by ASan.
Message-Id: <1453130811-22540-1-git-send-email-penberg@scylladb.com>
2016-01-20 10:29:34 +02:00
Pekka Enberg
bb0aeb9bb2 api/messaging_service: Fix heap-buffer-overflows in set_messaging_service()
Fix various issues in set_messaging_service() that caused
heap-buffer-overflows when JMX proxy connects to Scylla API:

  - Off-by-one error in 'num_verb' definition

  - Call to initializer list std::vector constructor variant that caused
    the vector to be two elements long.

  - Missing verb definitions from the Swagger definition that caused
    response vector to be too small.

Spotted by ASan.
Message-Id: <1453125439-16703-1-git-send-email-penberg@scylladb.com>
2016-01-20 10:29:27 +02:00
Takuya ASADA
d2c97d9620 dist: use our own CentOS7 Base image
Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453241256-23338-4-git-send-email-syuu@scylladb.com>
2016-01-20 09:41:39 +02:00
Takuya ASADA
ddbe20f65c dist: stop ntpd before running ntpdate
New CentOS Base Image runs ntpd by default, so shutdown it before running ntpdate.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453241256-23338-3-git-send-email-syuu@scylladb.com>
2016-01-20 09:41:33 +02:00
Takuya ASADA
88bf12aa0b dist: disable SELinux only when it enabled
New CentOS7 Base Image disabled SELinux by default, and running 'setenforce 0' on the image causes error, we won't able to build AMI.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453241256-23338-2-git-send-email-syuu@scylladb.com>
2016-01-20 09:41:29 +02:00
Takuya ASADA
87fdf2ee0d dist: extend coredump size limit
16GB is not enough for some larger machines, so extend it.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453115792-21989-2-git-send-email-syuu@scylladb.com>
2016-01-18 13:38:56 +02:00
Takuya ASADA
d6992189ed dist: preserve environment variable when running scylla_prepare on sudo
sysconfig parameters are passed via environment variables, but sudo resets it by default.
Need to keep them beyond sudo.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1453115792-21989-1-git-send-email-syuu@scylladb.com>
2016-01-18 13:23:55 +02:00
Tomasz Grabiec
5bf1afa059 config: Set default logging level to info
Commit d7b403db1f changed the default in
logging::logger. It affected tests but not scylla binary, where it's
being overwritten in main.cc.
Message-Id: <1452777008-21708-1-git-send-email-tgrabiec@scylladb.com>
2016-01-14 15:12:28 +02:00
Tomasz Grabiec
b013ed6357 cql3: Disable ALTER TABLE unless experimental features are on 2016-01-14 14:32:15 +02:00
Tomasz Grabiec
d4d0dd9cda tests: cql_test_env: Enable experimental features 2016-01-14 14:32:10 +02:00
Tomasz Grabiec
5865a43400 config: Add 'experimental' switch 2016-01-14 14:32:05 +02:00
Pekka Enberg
b81292d5d2 release: prepare for 0.16 2016-01-14 13:21:50 +02:00
14 changed files with 50 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
VERSION=666.development
VERSION=0.16
if test -f version
then

View File

@@ -253,7 +253,8 @@
"STREAM_MUTATION",
"STREAM_MUTATION_DONE",
"COMPLETE_MESSAGE",
"LAST"
"REPAIR_CHECKSUM_RANGE",
"GET_SCHEMA_VERSION"
]
}
}

View File

@@ -34,7 +34,7 @@ namespace api {
using shard_info = messaging_service::shard_info;
using msg_addr = messaging_service::msg_addr;
static const int32_t num_verb = static_cast<int32_t>(messaging_verb::LAST) + 1;
static const int32_t num_verb = static_cast<int32_t>(messaging_verb::LAST);
std::vector<message_counter> map_to_message_counters(
const std::unordered_map<gms::inet_address, unsigned long>& map) {
@@ -124,7 +124,7 @@ void set_messaging_service(http_context& ctx, routes& r) {
});
get_dropped_messages_by_ver.set(r, [](std::unique_ptr<request> req) {
shared_ptr<std::vector<uint64_t>> map = make_shared<std::vector<uint64_t>>(num_verb, 0);
shared_ptr<std::vector<uint64_t>> map = make_shared<std::vector<uint64_t>>(num_verb);
return net::get_messaging_service().map_reduce([map](const uint64_t* local_map) mutable {
for (auto i = 0; i < num_verb; i++) {
@@ -137,8 +137,12 @@ void set_messaging_service(http_context& ctx, routes& r) {
for (auto i : verb_counter::verb_wrapper::all_items()) {
verb_counter c;
messaging_verb v = i; // for type safety we use messaging_verb values
if ((*map)[static_cast<int32_t>(v)] > 0) {
c.count = (*map)[static_cast<int32_t>(v)];
auto idx = static_cast<uint32_t>(v);
if (idx >= map->size()) {
throw std::runtime_error(sprint("verb index out of bounds: %lu, map size: %lu", idx, map->size()));
}
if ((*map)[idx] > 0) {
c.count = (*map)[idx];
c.verb = i;
res.push_back(c);
}

View File

@@ -42,6 +42,7 @@
#include "cql3/statements/alter_table_statement.hh"
#include "service/migration_manager.hh"
#include "validation.hh"
#include "db/config.hh"
namespace cql3 {
@@ -77,9 +78,13 @@ void alter_table_statement::validate(distributed<service::storage_proxy>& proxy,
// validated in announce_migration()
}
static const sstring ALTER_TABLE_FEATURE = "ALTER TABLE";
future<bool> alter_table_statement::announce_migration(distributed<service::storage_proxy>& proxy, bool is_local_only)
{
auto& db = proxy.local().get_db().local();
db.get_config().check_experimental(ALTER_TABLE_FEATURE);
auto schema = validation::validate_column_family(db, keyspace(), column_family());
auto cfm = schema_builder(schema);

View File

@@ -30,6 +30,7 @@
#include "core/shared_ptr.hh"
#include "core/fstream.hh"
#include "core/do_with.hh"
#include "core/print.hh"
#include "log.hh"
#include <boost/any.hpp>
@@ -432,3 +433,9 @@ boost::filesystem::path db::config::get_conf_dir() {
return confdir;
}
void db::config::check_experimental(const sstring& what) const {
if (!experimental()) {
throw std::runtime_error(sprint("%s is currently disabled. Start Scylla with --experimental=on to enable.", what));
}
}

View File

@@ -102,6 +102,9 @@ public:
config();
// Throws exception if experimental feature is disabled.
void check_experimental(const sstring& what) const;
boost::program_options::options_description
get_options_description();
@@ -690,7 +693,7 @@ public:
val(ssl_storage_port, uint32_t, 7001, Used, \
"The SSL port for encrypted communication. Unused unless enabled in encryption_options." \
) \
val(default_log_level, sstring, "warn", Used, \
val(default_log_level, sstring, "info", Used, \
"Default log level for log messages. Valid values are trace, debug, info, warn, error.") \
val(logger_log_level, string_map, /* none */, Used,\
"map of logger name to log level. Valid values are trace, debug, info, warn, error. " \
@@ -717,6 +720,7 @@ public:
val(ring_delay_ms, uint32_t, 30 * 1000, Used, "Time a node waits to hear from other nodes before joining the ring in milliseconds. Same as -Dcassandra.ring_delay_ms in cassandra.") \
val(developer_mode, bool, false, Used, "Relax environement checks. Setting to true can reduce performance and reliability significantly.") \
val(skip_wait_for_gossip_to_settle, int32_t, -1, Used, "An integer to configure the wait for gossip to settle. -1: wait normally, 0: do not wait at all, n: wait for at most n polls. Same as -Dcassandra.skip_wait_for_gossip_to_settle in cassandra.") \
val(experimental, bool, false, Used, "Set to true to unlock experimental features.") \
/* done! */
#define _make_value_member(name, type, deflt, status, desc, ...) \
@@ -733,5 +737,4 @@ private:
int _dummy;
};
}

View File

@@ -8,7 +8,7 @@
"security_group_id": "{{user `security_group_id`}}",
"region": "{{user `region`}}",
"associate_public_ip_address": "{{user `associate_public_ip_address`}}",
"source_ami": "ami-61bbf104",
"source_ami": "ami-8ef1d6e4",
"user_data_file": "user_data.txt",
"instance_type": "{{user `instance_type`}}",
"ssh_username": "centos",

View File

@@ -31,8 +31,8 @@ else
[Coredump]
Storage=external
Compress=yes
ProcessSizeMax=16G
ExternalSizeMax=16G
ProcessSizeMax=1024G
ExternalSizeMax=1024G
EOS
if [ $SYMLINK = 1 ]; then
rm -rf /var/lib/systemd/coredump

View File

@@ -32,7 +32,10 @@ else
sed -e s#fedora.pool.ntp.org#amazon.pool.ntp.org# /etc/ntp.conf > /tmp/ntp.conf
mv /tmp/ntp.conf /etc/ntp.conf
fi
systemctl enable ntpd.service
if [ "`systemctl is-active ntpd`" = "active" ]; then
systemctl stop ntpd.service
fi
ntpdate `cat /etc/ntp.conf |grep "^server"|head -n1|awk '{print $2}'`
systemctl enable ntpd.service
systemctl start ntpd.service
fi

View File

@@ -39,9 +39,11 @@ SYSCONFIG_SETUP_ARGS="-n $NIC"
. /etc/os-release
if [ "$ID" != "ubuntu" ]; then
setenforce 0
sed -e "s/enforcing/disabled/" /etc/sysconfig/selinux > /tmp/selinux
mv /tmp/selinux /etc/sysconfig/
if [ "`sestatus | awk '{print $3}'`" != "disabled" ]; then
setenforce 0
sed -e "s/enforcing/disabled/" /etc/sysconfig/selinux > /tmp/selinux
mv /tmp/selinux /etc/sysconfig/
fi
if [ $AMI -eq 1 ]; then
SYSCONFIG_SETUP_ARGS="$SYSCONFIG_SETUP_ARGS -N -a"
if [ "$LOCAL_PKG" = "" ]; then

View File

@@ -1 +1 @@
scylla ALL=(ALL) NOPASSWD: /usr/lib/scylla/scylla_prepare,/usr/lib/scylla/scylla_stop
scylla ALL=(ALL) NOPASSWD:SETENV: /usr/lib/scylla/scylla_prepare,/usr/lib/scylla/scylla_stop

View File

@@ -9,9 +9,9 @@ LimitNOFILE=200000
LimitAS=infinity
LimitNPROC=8096
EnvironmentFile=/etc/sysconfig/scylla-server
ExecStartPre=/usr/bin/sudo /usr/lib/scylla/scylla_prepare
ExecStartPre=/usr/bin/sudo -E /usr/lib/scylla/scylla_prepare
ExecStart=/usr/lib/scylla/scylla_run
ExecStopPost=/usr/bin/sudo /usr/lib/scylla/scylla_stop
ExecStopPost=/usr/bin/sudo -E /usr/lib/scylla/scylla_stop
TimeoutStartSec=900
KillMode=process
Restart=no

View File

@@ -241,11 +241,12 @@ stream_session::~stream_session() = default;
future<> stream_session::init_streaming_service(distributed<database>& db) {
_db = &db;
engine().at_exit([] {
return _handlers.stop().then([]{
return get_stream_manager().stop();
});
});
// #293 - do not stop anything
// engine().at_exit([] {
// return _handlers.stop().then([]{
// return get_stream_manager().stop();
// });
// });
return get_stream_manager().start().then([] {
return _handlers.start().then([] {
return _handlers.invoke_on_all([] (handler& h) {

View File

@@ -272,6 +272,7 @@ public:
cfg->commitlog_directory() = _data_dir->path + "/commitlog.dir";
cfg->num_tokens() = 256;
cfg->ring_delay_ms() = 500;
cfg->experimental() = true;
boost::filesystem::create_directories((_data_dir->path + "/system").c_str());
boost::filesystem::create_directories(cfg->commitlog_directory().c_str());
tst_init_storage_service(*db).get();