Instead of just destroying the client, stop() it first and wait for that
to complete. Otherwise any connect in progress, or any requests in progress,
will access a destroyed object (in practice it will fail earlier when
the _stopped promise is destroyed without having been fulfilled).
Depends on rpc client stop patch.
"Issue #8 mentions the fact that we are missing some fields in legacy_schema_tables.
After this patchset, the only one missing is the subcomparator. That one only exists
for super tables - which we don't support - and will be null otherwise: so we don't
really need it."
Because we don't support alter table, we won't have anyone actually manipulating this.
But we will set up so it appears properly as an empty map in queries.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
When added to the schema and handled by legacy_schema_tables.cc, will then
appear correctly in the respective system tables.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
It will be stored in the schema, so move there, where it belongs. We'll need
to do more than just store a type, so provide a class that encapsulates it.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
So far, automatic compaction was disabled, but now that we support
size-tiered strategy, the default compaction strategy algorithm,
we could definitely enable automatic compaction by default.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Currently, compaction will no longer happen for a column family which
a compaction failed for some unexpected reason.
We want to implement a retry policy that will sleep for a while until
the next compaction attempt. This patch implements retry policy for
compaction using exponential_backoff_retry.
With exponential_backoff_retry, the sleep time grows exponentially
with the number of retries until the maximum sleep time is reached.
For compaction specifically, the base sleep time will be 5 seconds and
the maximum sleeping time will be 300 seconds, i.e. 5 minutes.
If compaction succeeded after a retry, the sleep time will be reset to
the base sleep time.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
We are targeting the 2.1.x series so advertise that we're Cassandra
2.1.8 which is the latest stable release.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This is a long-awaited cleanup. Gossiper code runs every second, it is
not performance sensitive, so it does not make much sense to stick to
lowres db_clock, use high_resolution_clock instead.
If we receive an unknown consistency level, fail with PROTOCOL_ERROR. If
we're trying to send out an unknown consistency level, fail with
SERVER_ERROR.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
If we don't recognize a frame version, throw a protocol_exception like
Origin does rather than killing the process.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
If the switch statements don't match to change or target type
enumerations, throw a invalid_argument exception that's translated to
proper SERVER_ERROR. The error is not triggerable in practice as
change_type and target_type are enumerations. However, the compiler is
unhappy if we don't have them so lets just clean them up.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Throw a runtime_exception which is translated to proper SERVER_ERROR
message rather than killing the process with assert().
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
If we encounter an unknown opcode, throw a protocol exception rather
than killing the process with assert().
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
"With the seastar patch below, if we have this code
engine().at_exit([] { return f1() });
engine().at_exit([] { return f2() });
We can make sure f2 is called before f1, like
f2.then([] {
reutrn f1();
})
We can use this feature to simplfy deinit code a lot. If we have the correct
init order, the deinit order will be correct if we always call
engine().at_exit() when we do init."
This patch introduce init.cc file which hosts all the initialization
code. The benefits are 1) we can share initialization code with tests
code. 2) all the service startup dependency / order code is in one
single place instead of everywhere.