Typos: fix typos in comments

Fixes some typos as found by codespell run on the code.
In this commit, I was hoping to fix only comments, not user-visible alerts, output, etc.
Follow-up commits will take care of them.

Refs: https://github.com/scylladb/scylladb/issues/16255
Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
This commit is contained in:
Yaniv Kaul
2023-12-02 22:37:22 +02:00
parent bae6f3387f
commit c658bdb150
242 changed files with 466 additions and 466 deletions

View File

@@ -342,7 +342,7 @@ static bool check_NOT_NULL(const rjson::value* val) {
} }
// Only types S, N or B (string, number or bytes) may be compared by the // Only types S, N or B (string, number or bytes) may be compared by the
// various comparion operators - lt, le, gt, ge, and between. // various comparison operators - lt, le, gt, ge, and between.
// Note that in particular, if the value is missing (v->IsNull()), this // Note that in particular, if the value is missing (v->IsNull()), this
// check returns false. // check returns false.
static bool check_comparable_type(const rjson::value& v) { static bool check_comparable_type(const rjson::value& v) {

View File

@@ -29,7 +29,7 @@ public:
std::string _type; std::string _type;
std::string _msg; std::string _msg;
// Additional data attached to the error, null value if not set. It's wrapped in copyable_value // Additional data attached to the error, null value if not set. It's wrapped in copyable_value
// class because copy contructor is required for exception classes otherwise it won't compile // class because copy constructor is required for exception classes otherwise it won't compile
// (despite that its use may be optimized away). // (despite that its use may be optimized away).
rjson::copyable_value _extra_fields; rjson::copyable_value _extra_fields;
api_error(std::string type, std::string msg, status_type http_code = status_type::bad_request, api_error(std::string type, std::string msg, status_type http_code = status_type::bad_request,

View File

@@ -994,7 +994,7 @@ static future<executor::request_return_type> create_table_on_shard0(tracing::tra
add_column(view_builder, view_range_key, attribute_definitions, column_kind::clustering_key); add_column(view_builder, view_range_key, attribute_definitions, column_kind::clustering_key);
} }
// Base key columns which aren't part of the index's key need to // Base key columns which aren't part of the index's key need to
// be added to the view nontheless, as (additional) clustering // be added to the view nonetheless, as (additional) clustering
// key(s). // key(s).
if (hash_key != view_hash_key && hash_key != view_range_key) { if (hash_key != view_hash_key && hash_key != view_range_key) {
add_column(view_builder, hash_key, attribute_definitions, column_kind::clustering_key); add_column(view_builder, hash_key, attribute_definitions, column_kind::clustering_key);
@@ -1051,7 +1051,7 @@ static future<executor::request_return_type> create_table_on_shard0(tracing::tra
} }
add_column(view_builder, view_range_key, attribute_definitions, column_kind::clustering_key); add_column(view_builder, view_range_key, attribute_definitions, column_kind::clustering_key);
// Base key columns which aren't part of the index's key need to // Base key columns which aren't part of the index's key need to
// be added to the view nontheless, as (additional) clustering // be added to the view nonetheless, as (additional) clustering
// key(s). // key(s).
if (!range_key.empty() && view_range_key != range_key) { if (!range_key.empty() && view_range_key != range_key) {
add_column(view_builder, range_key, attribute_definitions, column_kind::clustering_key); add_column(view_builder, range_key, attribute_definitions, column_kind::clustering_key);
@@ -2268,7 +2268,7 @@ enum class select_type { regular, count, projection };
static select_type parse_select(const rjson::value& request, table_or_view_type table_type) { static select_type parse_select(const rjson::value& request, table_or_view_type table_type) {
const rjson::value* select_value = rjson::find(request, "Select"); const rjson::value* select_value = rjson::find(request, "Select");
if (!select_value) { if (!select_value) {
// If "Select" is not specificed, it defaults to ALL_ATTRIBUTES // If "Select" is not specified, it defaults to ALL_ATTRIBUTES
// on a base table, or ALL_PROJECTED_ATTRIBUTES on an index // on a base table, or ALL_PROJECTED_ATTRIBUTES on an index
return table_type == table_or_view_type::base ? return table_type == table_or_view_type::base ?
select_type::regular : select_type::projection; select_type::regular : select_type::projection;
@@ -3124,7 +3124,7 @@ future<executor::request_return_type> executor::update_item(client_state& client
// Check according to the request's "ConsistentRead" field, which consistency // Check according to the request's "ConsistentRead" field, which consistency
// level we need to use for the read. The field can be True for strongly // level we need to use for the read. The field can be True for strongly
// consistent reads, or False for eventually consistent reads, or if this // consistent reads, or False for eventually consistent reads, or if this
// field is absense, we default to eventually consistent reads. // field is absence, we default to eventually consistent reads.
// In Scylla, eventually-consistent reads are implemented as consistency // In Scylla, eventually-consistent reads are implemented as consistency
// level LOCAL_ONE, and strongly-consistent reads as LOCAL_QUORUM. // level LOCAL_ONE, and strongly-consistent reads as LOCAL_QUORUM.
static db::consistency_level get_read_consistency(const rjson::value& request) { static db::consistency_level get_read_consistency(const rjson::value& request) {
@@ -3572,7 +3572,7 @@ public:
// the JSON but take them out before finally returning the JSON. // the JSON but take them out before finally returning the JSON.
if (_attrs_to_get) { if (_attrs_to_get) {
_filter.for_filters_on([&] (std::string_view attr) { _filter.for_filters_on([&] (std::string_view attr) {
std::string a(attr); // no heterogenous maps searches :-( std::string a(attr); // no heterogeneous maps searches :-(
if (!_attrs_to_get->contains(a)) { if (!_attrs_to_get->contains(a)) {
_extra_filter_attrs.emplace(std::move(a)); _extra_filter_attrs.emplace(std::move(a));
} }

View File

@@ -19,7 +19,7 @@ namespace alternator {
// operations which may involve a read of the item before the write // operations which may involve a read of the item before the write
// (so-called Read-Modify-Write operations). These operations include PutItem, // (so-called Read-Modify-Write operations). These operations include PutItem,
// UpdateItem and DeleteItem: All of these may be conditional operations (the // UpdateItem and DeleteItem: All of these may be conditional operations (the
// "Expected" parameter) which requir a read before the write, and UpdateItem // "Expected" parameter) which require a read before the write, and UpdateItem
// may also have an update expression which refers to the item's old value. // may also have an update expression which refers to the item's old value.
// //
// The code below supports running the read and the write together as one // The code below supports running the read and the write together as one
@@ -81,7 +81,7 @@ protected:
// it (see explanation below), but note that because apply() may be // it (see explanation below), but note that because apply() may be
// called more than once, if apply() will sometimes set this field it // called more than once, if apply() will sometimes set this field it
// must set it (even if just to the default empty value) every time. // must set it (even if just to the default empty value) every time.
// Additionaly when _returnvalues_on_condition_check_failure is ALL_OLD // Additionally when _returnvalues_on_condition_check_failure is ALL_OLD
// then condition check failure will also result in storing values here. // then condition check failure will also result in storing values here.
mutable rjson::value _return_attributes; mutable rjson::value _return_attributes;
public: public:

View File

@@ -59,7 +59,7 @@ type_representation represent_type(alternator_type atype) {
// calculate its magnitude and precision from its scale() and unscaled_value(). // calculate its magnitude and precision from its scale() and unscaled_value().
// So in the following ugly implementation we calculate them from the string // So in the following ugly implementation we calculate them from the string
// representation instead. We assume the number was already parsed // representation instead. We assume the number was already parsed
// sucessfully to a big_decimal to it follows its syntax rules. // successfully to a big_decimal to it follows its syntax rules.
// //
// FIXME: rewrite this function to take a big_decimal, not a string. // FIXME: rewrite this function to take a big_decimal, not a string.
// Maybe a snippet like this can help: // Maybe a snippet like this can help:

View File

@@ -280,7 +280,7 @@ struct sequence_number {
* Timeuuids viewed as msb<<64|lsb are _not_, * Timeuuids viewed as msb<<64|lsb are _not_,
* but they are still sorted as * but they are still sorted as
* timestamp() << 64|lsb * timestamp() << 64|lsb
* so we can simpy unpack the mangled msb * so we can simply unpack the mangled msb
* and use as hi 64 in our "bignum". * and use as hi 64 in our "bignum".
*/ */
uint128_t hi = uint64_t(num.uuid.timestamp()); uint128_t hi = uint64_t(num.uuid.timestamp());
@@ -419,7 +419,7 @@ using namespace std::string_literals;
* *
* In scylla, this is sort of akin to an ID having corresponding ID/ID:s * In scylla, this is sort of akin to an ID having corresponding ID/ID:s
* that cover the token range it represents. Because ID:s are per * that cover the token range it represents. Because ID:s are per
* vnode shard however, this relation can be somewhat ambigous. * vnode shard however, this relation can be somewhat ambiguous.
* We still provide some semblance of this by finding the ID in * We still provide some semblance of this by finding the ID in
* older generation that has token start < current ID token start. * older generation that has token start < current ID token start.
* This will be a partial overlap, but it is the best we can do. * This will be a partial overlap, but it is the best we can do.
@@ -526,7 +526,7 @@ future<executor::request_return_type> executor::describe_stream(client_state& cl
// (see explanation above) since we want to find closest // (see explanation above) since we want to find closest
// token boundary when determining parent. // token boundary when determining parent.
// #7346 - we processed and searched children/parents in // #7346 - we processed and searched children/parents in
// stored order, which is not neccesarily token order, // stored order, which is not necessarily token order,
// so the finding of "closest" token boundary (using upper bound) // so the finding of "closest" token boundary (using upper bound)
// could give somewhat weird results. // could give somewhat weird results.
static auto token_cmp = [](const cdc::stream_id& id1, const cdc::stream_id& id2) { static auto token_cmp = [](const cdc::stream_id& id1, const cdc::stream_id& id2) {

View File

@@ -155,7 +155,7 @@ future<executor::request_return_type> executor::describe_time_to_live(client_sta
// node owning this range as a "primary range" (the first node in the ring // node owning this range as a "primary range" (the first node in the ring
// with this range), but when this node is down, the secondary owner (the // with this range), but when this node is down, the secondary owner (the
// second in the ring) may take over. // second in the ring) may take over.
// An expiration thread is reponsible for all tables which need expiration // An expiration thread is responsible for all tables which need expiration
// scans. Currently, the different tables are scanned sequentially (not in // scans. Currently, the different tables are scanned sequentially (not in
// parallel). // parallel).
// The expiration thread scans item using CL=QUORUM to ensures that it reads // The expiration thread scans item using CL=QUORUM to ensures that it reads

View File

@@ -27,7 +27,7 @@ utils::time_estimated_histogram timed_rate_moving_average_summary_merge(utils::t
} }
/** /**
* This function implement a two dimentional map reduce where * This function implement a two dimensional map reduce where
* the first level is a distributed storage_proxy class and the * the first level is a distributed storage_proxy class and the
* second level is the stats per scheduling group class. * second level is the stats per scheduling group class.
* @param d - a reference to the storage_proxy distributed class. * @param d - a reference to the storage_proxy distributed class.
@@ -48,7 +48,7 @@ future<V> two_dimensional_map_reduce(distributed<service::storage_proxy>& d,
} }
/** /**
* This function implement a two dimentional map reduce where * This function implement a two dimensional map reduce where
* the first level is a distributed storage_proxy class and the * the first level is a distributed storage_proxy class and the
* second level is the stats per scheduling group class. * second level is the stats per scheduling group class.
* @param d - a reference to the storage_proxy distributed class. * @param d - a reference to the storage_proxy distributed class.

View File

@@ -1462,7 +1462,7 @@ void unset_storage_service(http_context& ctx, routes& r) {
enum class scrub_status { enum class scrub_status {
successful = 0, successful = 0,
aborted, aborted,
unable_to_cancel, // Not used in Scylla, included to ensure compability with nodetool api. unable_to_cancel, // Not used in Scylla, included to ensure compatibility with nodetool api.
validation_errors, validation_errors,
}; };

View File

@@ -68,4 +68,4 @@ bool check(const sstring& pass, const sstring& salted_hash) {
return detail::hash_with_salt(pass, salted_hash) == salted_hash; return detail::hash_with_salt(pass, salted_hash) == salted_hash;
} }
} // namespace auth::paswords } // namespace auth::passwords

View File

@@ -88,7 +88,7 @@ sstring hash_with_salt(const sstring& pass, const sstring& salt);
/// Prior to applying the hashing function, random salt is amended to the cleartext. The random salt bytes are generated /// Prior to applying the hashing function, random salt is amended to the cleartext. The random salt bytes are generated
/// according to the random number engine `g`. /// according to the random number engine `g`.
/// ///
/// The result is the encrypted cyphertext, and also the salt used but in a implementation-specific format. /// The result is the encrypted ciphertext, and also the salt used but in a implementation-specific format.
/// ///
/// \throws \ref std::system_error when the implementation-specific implementation fails to hash the cleartext. /// \throws \ref std::system_error when the implementation-specific implementation fails to hash the cleartext.
/// ///

View File

@@ -183,7 +183,7 @@ public:
// if we are turning off cdc we can skip this, since even if columns change etc, // if we are turning off cdc we can skip this, since even if columns change etc,
// any writer should see cdc -> off together with any actual schema changes to // any writer should see cdc -> off together with any actual schema changes to
// base table, so should never try to write to non-existent log column etc. // base table, so should never try to write to non-existent log column etc.
// note that if user has set ttl=0 in cdc options, he is still reponsible // note that if user has set ttl=0 in cdc options, he is still responsible
// for emptying the log. // for emptying the log.
if (is_cdc) { if (is_cdc) {
auto& db = _ctxt._proxy.get_db().local(); auto& db = _ctxt._proxy.get_db().local();

View File

@@ -28,7 +28,7 @@ class topology_description;
* (i.e., to pick partition keys for these writes). * (i.e., to pick partition keys for these writes).
*/ */
class metadata final { class metadata final {
// Note: we use db_clock (1ms resolution) for generation timestaps // Note: we use db_clock (1ms resolution) for generation timestamps
// (because we need to insert them into tables using columns of timestamp types, // (because we need to insert them into tables using columns of timestamp types,
// and the native type of our columns' timestamp_type is db_clock::time_point). // and the native type of our columns' timestamp_type is db_clock::time_point).
// On the other hand, timestamp_clock (1us resolution) is used for mutation timestamps, // On the other hand, timestamp_clock (1us resolution) is used for mutation timestamps,

View File

@@ -462,7 +462,7 @@ api::timestamp_type find_timestamp(const mutation& m) {
* The visitor uses the order in which the mutation is being visited (see the documentation of ChangeVisitor), * The visitor uses the order in which the mutation is being visited (see the documentation of ChangeVisitor),
* remembers a bunch of state based on whatever was visited until now (e.g. was there a static row update? * remembers a bunch of state based on whatever was visited until now (e.g. was there a static row update?
* Was there a clustered row update? Was there a clustered row delete? Was there a TTL?) * Was there a clustered row update? Was there a clustered row delete? Was there a TTL?)
* and tells the caller to stop on the first occurence of a second timestamp/ttl/type of change. * and tells the caller to stop on the first occurrence of a second timestamp/ttl/type of change.
*/ */
struct should_split_visitor { struct should_split_visitor {
bool _had_static_row = false; bool _had_static_row = false;

View File

@@ -32,7 +32,7 @@ endfunction()
macro(dist_submodule name dir pkgs) macro(dist_submodule name dir pkgs)
# defined as a macro, so that we can append the path to the dist tarball to # defined as a macro, so that we can append the path to the dist tarball to
# specfied "pkgs" # specified "pkgs"
cmake_parse_arguments(parsed_args "NOARCH" "" "" ${ARGN}) cmake_parse_arguments(parsed_args "NOARCH" "" "" ${ARGN})
if(parsed_args_NOARCH) if(parsed_args_NOARCH)
set(arch "noarch") set(arch "noarch")

View File

@@ -142,7 +142,7 @@ if(DEFINED ENV{NIX_CC})
get_padded_dynamic_linker_option(dynamic_linker_option 0) get_padded_dynamic_linker_option(dynamic_linker_option 0)
else() else()
# gdb has a SO_NAME_MAX_PATH_SIZE of 512, so limit the path size to # gdb has a SO_NAME_MAX_PATH_SIZE of 512, so limit the path size to
# that. The 512 includes the null at the end, hence the 511 bellow. # that. The 512 includes the null at the end, hence the 511 below.
get_padded_dynamic_linker_option(dynamic_linker_option 511) get_padded_dynamic_linker_option(dynamic_linker_option 511)
endif() endif()
add_link_options("${dynamic_linker_option}") add_link_options("${dynamic_linker_option}")

View File

@@ -743,7 +743,7 @@ private:
formatted_msg += sst; formatted_msg += sst;
// Do not actually compact a sstable that is fully expired and can be safely // Do not actually compact a sstable that is fully expired and can be safely
// dropped without ressurrecting old data. // dropped without resurrecting old data.
if (tombstone_expiration_enabled() && fully_expired.contains(sst)) { if (tombstone_expiration_enabled() && fully_expired.contains(sst)) {
log_debug("Fully expired sstable {} will be dropped on compaction completion", sst->get_filename()); log_debug("Fully expired sstable {} will be dropped on compaction completion", sst->get_filename());
continue; continue;

View File

@@ -34,7 +34,7 @@ sstring compaction_name(compaction_type type);
// to the compaction_type enum code. // to the compaction_type enum code.
compaction_type to_compaction_type(sstring type_name); compaction_type to_compaction_type(sstring type_name);
// Return a string respresenting the compaction type // Return a string representing the compaction type
// as a verb for logging purposes, e.g. "Compact" or "Cleanup". // as a verb for logging purposes, e.g. "Compact" or "Cleanup".
std::string_view to_string(compaction_type type); std::string_view to_string(compaction_type type);

View File

@@ -254,7 +254,7 @@ private:
// Propagate replacement of sstables to all ongoing compaction of a given table // Propagate replacement of sstables to all ongoing compaction of a given table
void propagate_replacement(compaction::table_state& t, const std::vector<sstables::shared_sstable>& removed, const std::vector<sstables::shared_sstable>& added); void propagate_replacement(compaction::table_state& t, const std::vector<sstables::shared_sstable>& removed, const std::vector<sstables::shared_sstable>& added);
// This constructor is suposed to only be used for testing so lets be more explicit // This constructor is supposed to only be used for testing so lets be more explicit
// about invoking it. Ref #10146 // about invoking it. Ref #10146
compaction_manager(tasks::task_manager& tm); compaction_manager(tasks::task_manager& tm);
public: public:

View File

@@ -222,7 +222,7 @@ future<> run_table_tasks(replica::database& db, std::vector<table_tasks_info> ta
std::exception_ptr ex; std::exception_ptr ex;
// While compaction is run on one table, the size of tables may significantly change. // While compaction is run on one table, the size of tables may significantly change.
// Thus, they are sorted before each invidual compaction and the smallest table is chosen. // Thus, they are sorted before each individual compaction and the smallest table is chosen.
while (!table_tasks.empty()) { while (!table_tasks.empty()) {
try { try {
if (sort) { if (sort) {
@@ -274,7 +274,7 @@ future<> run_keyspace_tasks(replica::database& db, std::vector<keyspace_tasks_in
std::exception_ptr ex; std::exception_ptr ex;
// While compaction is run on one table, the size of tables may significantly change. // While compaction is run on one table, the size of tables may significantly change.
// Thus, they are sorted before each invidual compaction and the smallest keyspace is chosen. // Thus, they are sorted before each individual compaction and the smallest keyspace is chosen.
while (!keyspace_tasks.empty()) { while (!keyspace_tasks.empty()) {
try { try {
if (sort) { if (sort) {

View File

@@ -24,7 +24,7 @@ num_tokens: 256
# Directory where Scylla should store all its files, which are commitlog, # Directory where Scylla should store all its files, which are commitlog,
# data, hints, view_hints and saved_caches subdirectories. All of these # data, hints, view_hints and saved_caches subdirectories. All of these
# subs can be overriden by the respective options below. # subs can be overridden by the respective options below.
# If unset, the value defaults to /var/lib/scylla # If unset, the value defaults to /var/lib/scylla
# workdir: /var/lib/scylla # workdir: /var/lib/scylla
@@ -385,7 +385,7 @@ commitlog_total_space_in_mb: -1
# tombstones seen in memory so we can return them to the coordinator, which # tombstones seen in memory so we can return them to the coordinator, which
# will use them to make sure other replicas also know about the deleted rows. # will use them to make sure other replicas also know about the deleted rows.
# With workloads that generate a lot of tombstones, this can cause performance # With workloads that generate a lot of tombstones, this can cause performance
# problems and even exaust the server heap. # problems and even exhaust the server heap.
# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets) # (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
# Adjust the thresholds here if you understand the dangers and want to # Adjust the thresholds here if you understand the dangers and want to
# scan more tombstones anyway. These thresholds may also be adjusted at runtime # scan more tombstones anyway. These thresholds may also be adjusted at runtime
@@ -397,7 +397,7 @@ commitlog_total_space_in_mb: -1
# Increase if your rows are large, or if you have a very large # Increase if your rows are large, or if you have a very large
# number of rows per partition. The competing goals are these: # number of rows per partition. The competing goals are these:
# 1) a smaller granularity means more index entries are generated # 1) a smaller granularity means more index entries are generated
# and looking up rows withing the partition by collation column # and looking up rows within the partition by collation column
# is faster # is faster
# 2) but, Scylla will keep the collation index in memory for hot # 2) but, Scylla will keep the collation index in memory for hot
# rows (as part of the key cache), so a larger granularity means # rows (as part of the key cache), so a larger granularity means
@@ -498,7 +498,7 @@ commitlog_total_space_in_mb: -1
# not met, performance and reliability can be degraded. # not met, performance and reliability can be degraded.
# #
# These requirements include: # These requirements include:
# - A filesystem with good support for aysnchronous I/O (AIO). Currently, # - A filesystem with good support for asynchronous I/O (AIO). Currently,
# this means XFS. # this means XFS.
# #
# false: strict environment checks are in place; do not start if they are not met. # false: strict environment checks are in place; do not start if they are not met.
@@ -535,7 +535,7 @@ commitlog_total_space_in_mb: -1
# [shard0] [shard1] ... [shardN-1] [shard0] [shard1] ... [shardN-1] ... # [shard0] [shard1] ... [shardN-1] [shard0] [shard1] ... [shardN-1] ...
# #
# Scylla versions 1.6 and below used just one repetition of the pattern; # Scylla versions 1.6 and below used just one repetition of the pattern;
# this intefered with data placement among nodes (vnodes). # this interfered with data placement among nodes (vnodes).
# #
# Scylla versions 1.7 and above use 4096 repetitions of the pattern; this # Scylla versions 1.7 and above use 4096 repetitions of the pattern; this
# provides for better data distribution. # provides for better data distribution.

View File

@@ -2421,7 +2421,7 @@ FLOAT
; ;
/* /*
* This has to be before IDENT so it takes precendence over it. * This has to be before IDENT so it takes precedence over it.
*/ */
BOOLEAN BOOLEAN
: T R U E | F A L S E : T R U E | F A L S E

View File

@@ -21,7 +21,7 @@ namespace cql3 {
class column_identifier_raw; class column_identifier_raw;
/** /**
* Represents an identifer for a CQL column definition. * Represents an identifier for a CQL column definition.
* TODO : should support light-weight mode without text representation for when not interned * TODO : should support light-weight mode without text representation for when not interned
*/ */
class column_identifier final { class column_identifier final {

View File

@@ -255,7 +255,7 @@ inline bool operator==(const cql3_type& a, const cql3_type& b) {
public static class UserDefined implements CQL3Type public static class UserDefined implements CQL3Type
{ {
// Keeping this separatly from type just to simplify toString() // Keeping this separately from type just to simplify toString()
private final String name; private final String name;
private final UserType type; private final UserType type;

View File

@@ -69,8 +69,8 @@ public:
virtual seastar::future<> check_access(query_processor& qp, const service::client_state& state) const = 0; virtual seastar::future<> check_access(query_processor& qp, const service::client_state& state) const = 0;
/** /**
* Perform additional validation required by the statment. * Perform additional validation required by the statement.
* To be overriden by subclasses if needed. * To be overridden by subclasses if needed.
* *
* @param state the current client state * @param state the current client state
*/ */

View File

@@ -76,7 +76,7 @@ extern bool is_supported_by(const expression&, const secondary_index::index&);
extern bool has_supporting_index( extern bool has_supporting_index(
const expression&, const secondary_index::secondary_index_manager&, allow_local_index allow_local); const expression&, const secondary_index::secondary_index_manager&, allow_local_index allow_local);
// Looks at each column indivudually and checks whether some index can support restrictions on this single column. // Looks at each column individually and checks whether some index can support restrictions on this single column.
// Expression has to consist only of single column restrictions. // Expression has to consist only of single column restrictions.
extern bool index_supports_some_column( extern bool index_supports_some_column(
const expression&, const expression&,
@@ -231,7 +231,7 @@ bool has_eq_restriction_on_column(const column_definition& column, const express
/// column_value. /// column_value.
extern expression replace_column_def(const expression&, const column_definition*); extern expression replace_column_def(const expression&, const column_definition*);
// Replaces all occurences of token(p1, p2) on the left hand side with the given colum. // Replaces all occurrences of token(p1, p2) on the left hand side with the given column.
// For example this changes token(p1, p2) < token(1, 2) to my_column_name < token(1, 2). // For example this changes token(p1, p2) < token(1, 2) to my_column_name < token(1, 2).
// Schema is needed to find out which calls to token() describe the partition token. // Schema is needed to find out which calls to token() describe the partition token.
extern expression replace_partition_token(const expression&, const column_definition*, const schema&); extern expression replace_partition_token(const expression&, const column_definition*, const schema&);
@@ -355,7 +355,7 @@ data_type column_mutation_attribute_type(const column_mutation_attribute& e);
// How deep aggregations are nested. e.g. sum(avg(count(col))) == 3 // How deep aggregations are nested. e.g. sum(avg(count(col))) == 3
unsigned aggregation_depth(const cql3::expr::expression& e); unsigned aggregation_depth(const cql3::expr::expression& e);
// Make sure evey column_value or column_mutation_attribute is nested in exactly `depth` aggregations, by adding // Make sure every column_value or column_mutation_attribute is nested in exactly `depth` aggregations, by adding
// first() calls at the deepest level. e.g. if depth=3, then // first() calls at the deepest level. e.g. if depth=3, then
// //
// my_agg(sum(x), y) // my_agg(sum(x), y)

View File

@@ -161,7 +161,7 @@ get_value(const subscript& s, const evaluation_inputs& inputs) {
// For m[null] return null. // For m[null] return null.
// This is different from Cassandra - which treats m[null] // This is different from Cassandra - which treats m[null]
// as an invalid request error. But m[null] -> null is more // as an invalid request error. But m[null] -> null is more
// consistent with our usual null treatement (e.g., both // consistent with our usual null treatment (e.g., both
// null[2] and null < 2 return null). It will also allow us // null[2] and null < 2 return null). It will also allow us
// to support non-constant subscripts (e.g., m[a]) where "a" // to support non-constant subscripts (e.g., m[a]) where "a"
// may be null in some rows and non-null in others, and it's // may be null in some rows and non-null in others, and it's
@@ -1679,14 +1679,14 @@ cql3::raw_value do_evaluate(const binary_operator& binop, const evaluation_input
} }
// Evaluate a conjunction of elements separated by AND. // Evaluate a conjunction of elements separated by AND.
// NULL is treated as an "unkown value" - maybe true maybe false. // NULL is treated as an "unknown value" - maybe true maybe false.
// `TRUE AND NULL` evaluates to NULL because it might be true but also might be false. // `TRUE AND NULL` evaluates to NULL because it might be true but also might be false.
// `FALSE AND NULL` evaluates to FALSE because no matter what value NULL acts as, the result will still be FALSE. // `FALSE AND NULL` evaluates to FALSE because no matter what value NULL acts as, the result will still be FALSE.
// Empty values are not allowed. // Empty values are not allowed.
// //
// Usually in CQL the rule is that when NULL occurs in an operation the whole expression // Usually in CQL the rule is that when NULL occurs in an operation the whole expression
// becomes NULL, but here we decided to deviate from this behavior. // becomes NULL, but here we decided to deviate from this behavior.
// Treating NULL as an "unkown value" is the standard SQL way of handing NULLs in conjunctions. // Treating NULL as an "unknown value" is the standard SQL way of handing NULLs in conjunctions.
// It works this way in MySQL and Postgres so we do it this way as well. // It works this way in MySQL and Postgres so we do it this way as well.
// //
// The evaluation short-circuits. Once FALSE is encountered the function returns FALSE // The evaluation short-circuits. Once FALSE is encountered the function returns FALSE

View File

@@ -835,7 +835,7 @@ sql_cast_prepare_expression(const cast& c, data_dictionary::database db, const s
throw exceptions::invalid_request_exception(fmt::format("Could not infer type of cast argument {}", c.arg)); throw exceptions::invalid_request_exception(fmt::format("Could not infer type of cast argument {}", c.arg));
} }
// cast to the same type should be ommited // cast to the same type should be omitted
if (cast_type == type_of(*prepared_arg)) { if (cast_type == type_of(*prepared_arg)) {
return prepared_arg; return prepared_arg;
} }
@@ -1140,7 +1140,7 @@ try_prepare_expression(const expression& expr, data_dictionary::database db, con
constant result = value; constant result = value;
if (receiver) { if (receiver) {
// The receiver might have a different type from the constant, but this is allowed if the types are compatible. // The receiver might have a different type from the constant, but this is allowed if the types are compatible.
// In such case the type is implictly converted to receiver type. // In such case the type is implicitly converted to receiver type.
result.type = receiver->type; result.type = receiver->type;
} }
return result; return result;

View File

@@ -155,7 +155,7 @@ void preliminary_binop_vaidation_checks(const binary_operator& binop) {
// Right now a token() on the LHS means that there's a partition token there. // Right now a token() on the LHS means that there's a partition token there.
// In the future with relaxed grammar this might no longer be true and this check will have to be revisisted. // In the future with relaxed grammar this might no longer be true and this check will have to be revisisted.
// Moving the check after preparation would break tests and cassandra compatability. // Moving the check after preparation would break tests and cassandra compatibility.
if (is_token_function(binop.lhs)) { if (is_token_function(binop.lhs)) {
if (binop.op == oper_t::IN) { if (binop.op == oper_t::IN) {
throw exceptions::invalid_request_exception("IN cannot be used with the token function"); throw exceptions::invalid_request_exception("IN cannot be used with the token function");

View File

@@ -149,7 +149,7 @@ NarrowT
narrow(WideT acc) { narrow(WideT acc) {
NarrowT ret = static_cast<NarrowT>(acc); NarrowT ret = static_cast<NarrowT>(acc);
// The following check only makes sense when NarrowT and WideT are two // The following check only makes sense when NarrowT and WideT are two
// different integeral types and we want to check that NarrowT isn't too // different integral types and we want to check that NarrowT isn't too
// narrow. Let's avoid the check when they are the same type - it is // narrow. Let's avoid the check when they are the same type - it is
// useless, and worse - wrong for the floating-point case (issue #13564). // useless, and worse - wrong for the floating-point case (issue #13564).
if constexpr (!std::is_same<WideT, NarrowT>::value) { if constexpr (!std::is_same<WideT, NarrowT>::value) {

View File

@@ -126,7 +126,7 @@ public:
// "Touch" the corresponding cache entry in order to bump up its reference count. // "Touch" the corresponding cache entry in order to bump up its reference count.
void touch(const key_type& key) { void touch(const key_type& key) {
// loading_cache::find() returns a value_ptr object which contructor does the "thouching". // loading_cache::find() returns a value_ptr object which constructor does the "thouching".
_cache.find(key.key()); _cache.find(key.key());
} }

View File

@@ -622,7 +622,7 @@ std::vector<const column_definition*> statement_restrictions::get_column_defs_fo
void statement_restrictions::add_restriction(const expr::binary_operator& restr, schema_ptr schema, bool allow_filtering, bool for_view) { void statement_restrictions::add_restriction(const expr::binary_operator& restr, schema_ptr schema, bool allow_filtering, bool for_view) {
if (restr.op == expr::oper_t::IS_NOT) { if (restr.op == expr::oper_t::IS_NOT) {
// Handle IS NOT NULL restrictions seperately // Handle IS NOT NULL restrictions separately
add_is_not_restriction(restr, schema, for_view); add_is_not_restriction(restr, schema, for_view);
} else if (expr::is_multi_column(restr)) { } else if (expr::is_multi_column(restr)) {
// Multi column restrictions are only allowed on clustering columns // Multi column restrictions are only allowed on clustering columns
@@ -791,10 +791,10 @@ void statement_restrictions::add_single_column_nonprimary_key_restriction(const
} }
void statement_restrictions::process_partition_key_restrictions(bool for_view, bool allow_filtering) { void statement_restrictions::process_partition_key_restrictions(bool for_view, bool allow_filtering) {
// If there is a queriable index, no special condition are required on the other restrictions. // If there is a queryable index, no special condition are required on the other restrictions.
// But we still need to know 2 things: // But we still need to know 2 things:
// - If we don't have a queriable index, is the query ok // - If we don't have a queryable index, is the query ok
// - Is it queriable without 2ndary index, which is always more efficient // - Is it queryable without 2ndary index, which is always more efficient
// If a component of the partition key is restricted by a relation, all preceding // If a component of the partition key is restricted by a relation, all preceding
// components must have a EQ. Only the last partition key component can be in IN relation. // components must have a EQ. Only the last partition key component can be in IN relation.
if (has_token_restrictions()) { if (has_token_restrictions()) {
@@ -904,7 +904,7 @@ bool statement_restrictions::multi_column_clustering_restrictions_are_supported_
return supported_column != nullptr; return supported_column != nullptr;
} }
// Otherwise it has to be a singe binary operator with EQ or IN. // Otherwise it has to be a single binary operator with EQ or IN.
// This is checked earlier during add_restriction. // This is checked earlier during add_restriction.
const expr::binary_operator* single_binop = const expr::binary_operator* single_binop =
expr::as_if<expr::binary_operator>(&_clustering_columns_restrictions); expr::as_if<expr::binary_operator>(&_clustering_columns_restrictions);

View File

@@ -99,7 +99,7 @@ private:
/// Recall that the index-table CK is (token, PK, CK) of the base table for a global index and (indexed column, /// Recall that the index-table CK is (token, PK, CK) of the base table for a global index and (indexed column,
/// CK) for a local index. /// CK) for a local index.
/// ///
/// Elements are conjuctions of single-column binary operators with the same LHS. /// Elements are conjunctions of single-column binary operators with the same LHS.
/// Element order follows the indexing-table clustering key. /// Element order follows the indexing-table clustering key.
/// In case of a global index the first element's (token restriction) RHS is a dummy value, it is filled later. /// In case of a global index the first element's (token restriction) RHS is a dummy value, it is filled later.
std::optional<std::vector<expr::expression>> _idx_tbl_ck_prefix; std::optional<std::vector<expr::expression>> _idx_tbl_ck_prefix;

View File

@@ -79,7 +79,7 @@ protected:
virtual ~selection() {} virtual ~selection() {}
public: public:
// Overriden by SimpleSelection when appropriate. // Overridden by SimpleSelection when appropriate.
virtual bool is_wildcard() const { virtual bool is_wildcard() const {
return false; return false;
} }

View File

@@ -71,7 +71,7 @@ schema::extensions_map cf_prop_defs::make_schema_extensions(const db::extensions
} }
void cf_prop_defs::validate(const data_dictionary::database db, sstring ks_name, const schema::extensions_map& schema_extensions) const { void cf_prop_defs::validate(const data_dictionary::database db, sstring ks_name, const schema::extensions_map& schema_extensions) const {
// Skip validation if the comapction strategy class is already set as it means we've alreayd // Skip validation if the comapction strategy class is already set as it means we've already
// prepared (and redoing it would set strategyClass back to null, which we don't want) // prepared (and redoing it would set strategyClass back to null, which we don't want)
if (_compaction_strategy_class) { if (_compaction_strategy_class) {
return; return;

View File

@@ -26,8 +26,8 @@ cf_statement::cf_statement(std::optional<cf_name> cf_name)
void cf_statement::prepare_keyspace(const service::client_state& state) void cf_statement::prepare_keyspace(const service::client_state& state)
{ {
if (!_cf_name->has_keyspace()) { if (!_cf_name->has_keyspace()) {
// XXX: We explicitely only want to call state.getKeyspace() in this case, as we don't want to throw // XXX: We explicitly only want to call state.getKeyspace() in this case, as we don't want to throw
// if not logged in any keyspace but a keyspace is explicitely set on the statement. So don't move // if not logged in any keyspace but a keyspace is explicitly set on the statement. So don't move
// the call outside the 'if' or replace the method by 'prepareKeyspace(state.getKeyspace())' // the call outside the 'if' or replace the method by 'prepareKeyspace(state.getKeyspace())'
_cf_name->set_keyspace(state.get_keyspace(), true); _cf_name->set_keyspace(state.get_keyspace(), true);
} }

View File

@@ -70,14 +70,14 @@ struct description {
sstring _name; sstring _name;
std::optional<sstring> _create_statement; std::optional<sstring> _create_statement;
// Descritpion without create_statement // Description without create_statement
description(replica::database& db, const keyspace_element& element) description(replica::database& db, const keyspace_element& element)
: _keyspace(util::maybe_quote(element.keypace_name())) : _keyspace(util::maybe_quote(element.keypace_name()))
, _type(element.element_type(db)) , _type(element.element_type(db))
, _name(util::maybe_quote(element.element_name())) , _name(util::maybe_quote(element.element_name()))
, _create_statement(std::nullopt) {} , _create_statement(std::nullopt) {}
// Descritpion with create_statement // Description with create_statement
description(replica::database& db, const keyspace_element& element, bool with_internals) description(replica::database& db, const keyspace_element& element, bool with_internals)
: _keyspace(util::maybe_quote(element.keypace_name())) : _keyspace(util::maybe_quote(element.keypace_name()))
, _type(element.element_type(db)) , _type(element.element_type(db))

View File

@@ -79,7 +79,7 @@ void drop_type_statement::validate_while_executing(query_processor& qp) const {
// yet apply the drop mutations after -> inconsistent data! // yet apply the drop mutations after -> inconsistent data!
// This problem is the same in origin, and I see no good way around it // This problem is the same in origin, and I see no good way around it
// as long as the atomicity of schema modifications are based on // as long as the atomicity of schema modifications are based on
// actual appy of mutations, because unlike other drops, this one isn't // actual apply of mutations, because unlike other drops, this one isn't
// benevolent. // benevolent.
// I guess this is one case where user need beware, and don't mess with types // I guess this is one case where user need beware, and don't mess with types
// concurrently! // concurrently!

View File

@@ -70,7 +70,7 @@ static std::map<sstring, sstring> prepare_options(
} }
void ks_prop_defs::validate() { void ks_prop_defs::validate() {
// Skip validation if the strategy class is already set as it means we've alreayd // Skip validation if the strategy class is already set as it means we've already
// prepared (and redoing it would set strategyClass back to null, which we don't want) // prepared (and redoing it would set strategyClass back to null, which we don't want)
if (_strategy_class) { if (_strategy_class) {
return; return;

View File

@@ -173,7 +173,7 @@ public:
private: private:
// Return true if this statement doesn't update or read any regular rows, only static rows. // Return true if this statement doesn't update or read any regular rows, only static rows.
// Note, it isn't enought to just check !_sets_regular_columns && _regular_conditions.empty(), // Note, it isn't enough to just check !_sets_regular_columns && _regular_conditions.empty(),
// because a DELETE statement that deletes whole rows (DELETE FROM ...) technically doesn't // because a DELETE statement that deletes whole rows (DELETE FROM ...) technically doesn't
// have any column operations and hence doesn't have _sets_regular_columns set. It doesn't // have any column operations and hence doesn't have _sets_regular_columns set. It doesn't
// have _sets_static_columns set either so checking the latter flag too here guarantees that // have _sets_static_columns set either so checking the latter flag too here guarantees that

View File

@@ -667,9 +667,9 @@ indexed_table_select_statement::do_execute_base_query(
// //
// This means that we should not set a open_ended_both_sides // This means that we should not set a open_ended_both_sides
// clustering range on base_pk, instead intersect it with // clustering range on base_pk, instead intersect it with
// _row_ranges (which contains the restrictions neccessary for the // _row_ranges (which contains the restrictions necessary for the
// case described above). The result of such intersection is just // case described above). The result of such intersection is just
// _row_ranges, which we explicity set on base_pk. // _row_ranges, which we explicitly set on base_pk.
command->slice.set_range(*_schema, base_pk, row_ranges); command->slice.set_range(*_schema, base_pk, row_ranges);
} }
} }
@@ -2179,7 +2179,7 @@ select_statement::prepared_orderings_type select_statement::prepare_orderings(co
prepared_orderings.emplace_back(def, column_ordering); prepared_orderings.emplace_back(def, column_ordering);
} }
// Uncomment this to allow specifing ORDER BY columns in any order. // Uncomment this to allow specifying ORDER BY columns in any order.
// Right now specifying ORDER BY (c2 asc, c1 asc) is illegal, it can only be ORDER BY (c1 asc, c2 asc). // Right now specifying ORDER BY (c2 asc, c1 asc) is illegal, it can only be ORDER BY (c1 asc, c2 asc).
// //
// std::sort(prepared_orderings.begin(), prepared_orderings.end(), // std::sort(prepared_orderings.begin(), prepared_orderings.end(),

View File

@@ -94,7 +94,7 @@ template <typename T> static T to_int(const rjson::value& value) {
} }
return u64_result; return u64_result;
} else if (value.IsDouble()) { } else if (value.IsDouble()) {
// We allow specifing integer constants // We allow specifying integer constants
// using scientific notation (for example 1.3e8) // using scientific notation (for example 1.3e8)
// and floating-point numbers ending with .0 (for example 12.0), // and floating-point numbers ending with .0 (for example 12.0),
// but not floating-point numbers with fractional part (12.34). // but not floating-point numbers with fractional part (12.34).

View File

@@ -204,7 +204,7 @@ struct db::commitlog::entry_writer {
* Should return the total, exact, size for all entries + overhead (i.e. schema) * Should return the total, exact, size for all entries + overhead (i.e. schema)
* for this segment. * for this segment.
* *
* Can be called more than once, if segment switch is neccesary (because race) * Can be called more than once, if segment switch is necessary (because race)
*/ */
virtual size_t size(segment&) = 0; virtual size_t size(segment&) = 0;
/** /**
@@ -627,7 +627,7 @@ std::enable_if_t<std::is_fundamental<T>::value, T> read(Input& in) {
/* /*
* A single commit log file on disk. Manages creation of the file and writing mutations to disk, * A single commit log file on disk. Manages creation of the file and writing mutations to disk,
* as well as tracking the last mutation position of any "dirty" CFs covered by the segment file. Segment * as well as tracking the last mutation position of any "dirty" CFs covered by the segment file. Segment
* files are initially allocated to a fixed size and can grow to accomidate a larger value if necessary. * files are initially allocated to a fixed size and can grow to accommodate a larger value if necessary.
* *
* The IO flow is somewhat convoluted and goes something like this: * The IO flow is somewhat convoluted and goes something like this:
* *
@@ -654,7 +654,7 @@ std::enable_if_t<std::is_fundamental<T>::value, T> read(Input& in) {
* Note that we do not care which order segment chunks finish writing * Note that we do not care which order segment chunks finish writing
* to disk, other than all below a flush point must finish before flushing. * to disk, other than all below a flush point must finish before flushing.
* *
* We currently do not wait for flushes to finish before issueing the next * We currently do not wait for flushes to finish before issuing the next
* cycle call ("after" flush point in the file). This might not be optimal. * cycle call ("after" flush point in the file). This might not be optimal.
* *
* To close and finish a segment, we first close the gate object that guards * To close and finish a segment, we first close the gate object that guards
@@ -1108,7 +1108,7 @@ public:
} catch (...) { } catch (...) {
// If we get an IO exception (which we assume this is) // If we get an IO exception (which we assume this is)
// we should close the segment. // we should close the segment.
// TODO: should we also trunctate away any partial write // TODO: should we also truncate away any partial write
// we did? // we did?
me->_closed = true; // just mark segment as closed, no writes will be done. me->_closed = true; // just mark segment as closed, no writes will be done.
throw; throw;
@@ -2216,7 +2216,7 @@ future<> db::commitlog::segment_manager::do_pending_deletes() {
} }
// #8376 - if we had an error in recycling (disk rename?), and no elements // #8376 - if we had an error in recycling (disk rename?), and no elements
// are available, we could have waiters hoping they will get segements. // are available, we could have waiters hoping they will get segments.
// abort the queue (wakes up any existing waiters - futures), and let them // abort the queue (wakes up any existing waiters - futures), and let them
// retry. Since we did deletions instead, disk footprint should allow // retry. Since we did deletions instead, disk footprint should allow
// for new allocs at least. Or more likely, everything is broken, but // for new allocs at least. Or more likely, everything is broken, but

View File

@@ -65,7 +65,7 @@ class extensions;
* Code should ensure to use discard_completed_segments with UUID + * Code should ensure to use discard_completed_segments with UUID +
* highest rp once a memtable has been flushed. This will allow * highest rp once a memtable has been flushed. This will allow
* discarding used segments. Failure to do so will keep stuff * discarding used segments. Failure to do so will keep stuff
* indefinately. * indefinitely.
*/ */
class commitlog { class commitlog {
public: public:
@@ -186,7 +186,7 @@ public:
/** /**
* Template version of add. * Template version of add.
* Resolves with timed_out_error when timeout is reached. * Resolves with timed_out_error when timeout is reached.
* @param mu an invokable op that generates the serialized data. (Of size bytes) * @param mu an invocable op that generates the serialized data. (Of size bytes)
*/ */
template<typename MutationOp> template<typename MutationOp>
future<rp_handle> add_mutation(const cf_id_type& id, size_t size, db::timeout_clock::time_point timeout, force_sync sync, MutationOp&& mu) { future<rp_handle> add_mutation(const cf_id_type& id, size_t size, db::timeout_clock::time_point timeout, force_sync sync, MutationOp&& mu) {
@@ -197,7 +197,7 @@ public:
/** /**
* Template version of add. * Template version of add.
* @param mu an invokable op that generates the serialized data. (Of size bytes) * @param mu an invocable op that generates the serialized data. (Of size bytes)
*/ */
template<typename MutationOp> template<typename MutationOp>
future<rp_handle> add_mutation(const cf_id_type& id, size_t size, force_sync sync, MutationOp&& mu) { future<rp_handle> add_mutation(const cf_id_type& id, size_t size, force_sync sync, MutationOp&& mu) {

View File

@@ -218,7 +218,7 @@ void assure_sufficient_live_nodes(
if (assure_sufficient_live_nodes_each_quorum(cl, erm, live_endpoints, pending_endpoints)) { if (assure_sufficient_live_nodes_each_quorum(cl, erm, live_endpoints, pending_endpoints)) {
break; break;
} }
// Fallthough on purpose for SimpleStrategy // Fallthrough on purpose for SimpleStrategy
[[fallthrough]]; [[fallthrough]];
default: default:
size_t live = live_endpoints.size(); size_t live = live_endpoints.size();
@@ -300,7 +300,7 @@ filter_for_query(consistency_level cl,
// are 0.01 and 0.02, so equalizing the miss numbers will send // are 0.01 and 0.02, so equalizing the miss numbers will send
// the first node twice the requests. But unless the disk is // the first node twice the requests. But unless the disk is
// extremely slow, at such high hit ratios the disk work is // extremely slow, at such high hit ratios the disk work is
// negligable and we want these two nodes to get equal work. // negligible and we want these two nodes to get equal work.
// 2. Even if one node has perfect cache hit ratio (near 1.0), // 2. Even if one node has perfect cache hit ratio (near 1.0),
// and the other near 0, we want the near-0 node to get some // and the other near 0, we want the near-0 node to get some
// of the work to warm up its cache. When max_hit_rate=0.95 // of the work to warm up its cache. When max_hit_rate=0.95
@@ -378,7 +378,7 @@ is_sufficient_live_nodes(consistency_level cl,
} }
} }
[[fallthrough]]; [[fallthrough]];
// Fallthough on purpose for SimpleStrategy // Fallthrough on purpose for SimpleStrategy
default: default:
return live_endpoints.size() >= block_for(erm, cl); return live_endpoints.size() >= block_for(erm, cl);
} }

View File

@@ -39,7 +39,7 @@ public:
const stateless_aggregate_function& get_aggregate() const; const stateless_aggregate_function& get_aggregate() const;
/** /**
* Checks wheather the function can be distributed and is able to reduce states. * Checks whether the function can be distributed and is able to reduce states.
* *
* @return <code>true</code> if the function is reducible, <code>false</code> otherwise. * @return <code>true</code> if the function is reducible, <code>false</code> otherwise.
*/ */

View File

@@ -44,7 +44,7 @@ rand_float() {
// This implementation has complexity O(N). If we plan to call randone() // This implementation has complexity O(N). If we plan to call randone()
// many times on the same probability vector, and if N can grow large, // many times on the same probability vector, and if N can grow large,
// we should consider a different implementation, known as "The Alias Method", // we should consider a different implementation, known as "The Alias Method",
// which has O(N) preperation stage but then only O(1) for each call. // which has O(N) preparation stage but then only O(1) for each call.
// The alias method was first suggested by A.J. Walker in 1977 and later // The alias method was first suggested by A.J. Walker in 1977 and later
// refined by Knuth and others. Here is a short overview of this method: // refined by Knuth and others. Here is a short overview of this method:
// The O(N) implementation of randone() divides the interval [0,1) into // The O(N) implementation of randone() divides the interval [0,1) into
@@ -100,21 +100,21 @@ randone(const std::vector<float>& p, float rnd = rand_float()) {
// than 1/K: even if we return item i in *every* K-combination, item i will // than 1/K: even if we return item i in *every* K-combination, item i will
// still be only 1/K of the produced items. To reach p[i] > 1/K will mean // still be only 1/K of the produced items. To reach p[i] > 1/K will mean
// some combinations will need to contain more than one copy of i - which // some combinations will need to contain more than one copy of i - which
// contradicts the defintion of a "combination". // contradicts the definition of a "combination".
// //
// Though ssample() is required to fulfill the first-order inclusion // Though ssample() is required to fulfill the first-order inclusion
// probabilities p (the probability of each item appearing in the returned // probabilities p (the probability of each item appearing in the returned
// combination), it is NOT required to make any guarantees on the high-order // combination), it is NOT required to make any guarantees on the high-order
// inclusion probabilities, i.e., the probablities for pairs of items to // inclusion probabilities, i.e., the probabilities for pairs of items to
// be returned together in the same combination. This greatly simplifies // be returned together in the same combination. This greatly simplifies
// the implementation, and means we can use the "Systematic Sampling" // the implementation, and means we can use the "Systematic Sampling"
// technique (explained below) which only makes guarantees on the first-order // technique (explained below) which only makes guarantees on the first-order
// inclusion probablities. In our use case, fulfilling *only* the 1st order // inclusion probabilities. In our use case, fulfilling *only* the 1st order
// inclusion probabilities is indeed enough: We want that each node gets a // inclusion probabilities is indeed enough: We want that each node gets a
// given amount of work, but don't care if the different K nodes we choose // given amount of work, but don't care if the different K nodes we choose
// in one request are correlated. // in one request are correlated.
// //
// Not making any guarantees on high-order inclusion probablities basically // Not making any guarantees on high-order inclusion probabilities basically
// means that the items are not independent. To understand what this means, // means that the items are not independent. To understand what this means,
// consider a simple example: say we have N=4 items with equal probability // consider a simple example: say we have N=4 items with equal probability
// and want to draw random pairs (K=2). Our implementation will return {0,1} // and want to draw random pairs (K=2). Our implementation will return {0,1}
@@ -138,16 +138,16 @@ randone(const std::vector<float>& p, float rnd = rand_float()) {
// 2. The probability to choose each item is exactly p_i*K. // 2. The probability to choose each item is exactly p_i*K.
// //
// ssample() only calls for one random number generation (this is important // ssample() only calls for one random number generation (this is important
// for performance) but calls randone() on the same probablity vector K times, // for performance) but calls randone() on the same probability vector K times,
// which makes it even more interesting to implement the Alias Method // which makes it even more interesting to implement the Alias Method
// described above. However, for very small N like 3, the difference is not // described above. However, for very small N like 3, the difference is not
// likely to be noticable. // likely to be noticeable.
// //
// TODO: For the special case of K == N-1, we can have a slightly more // TODO: For the special case of K == N-1, we can have a slightly more
// efficient implementation, which calculates the probability for each of // efficient implementation, which calculates the probability for each of
// the N combinations (the combination lacking item i can be proven to have // the N combinations (the combination lacking item i can be proven to have
// probablity 1 - K*p[i]) and then uses one randone() call with these // probability 1 - K*p[i]) and then uses one randone() call with these
// modified probablities. // modified probabilities.
// TODO: Consider making this a template of K, N and have specialized // TODO: Consider making this a template of K, N and have specialized
// implementations for low N (e.g., 3), K=N-1, etc. // implementations for low N (e.g., 3), K=N-1, etc.
// TODO: write to a pre-allocated return vector to avoid extra allocation. // TODO: write to a pre-allocated return vector to avoid extra allocation.
@@ -187,7 +187,7 @@ miss_equalizing_probablities(const std::vector<float>& hit_rates) {
return ret; return ret;
} }
// Given a set of desired probablities with sum 1, clip the probablities // Given a set of desired probabilities with sum 1, clip the probabilities
// to be not higher than the given limit. The rest of the probabilities are // to be not higher than the given limit. The rest of the probabilities are
// increased, in an attempt to preserve the ratios between probabilities, // increased, in an attempt to preserve the ratios between probabilities,
// if possible - but keep all the probabilities below the limit. // if possible - but keep all the probabilities below the limit.
@@ -286,7 +286,7 @@ redistribute(const std::vector<float>& p, unsigned me, unsigned k) {
// min(deficit[me], mixed_surplus). // min(deficit[me], mixed_surplus).
// TODO: use NlgN sort instead of this ridiculous N^2 implementation. // TODO: use NlgN sort instead of this ridiculous N^2 implementation.
// TODO: can we do this without a NlgN (although very small N, not even // TODO: can we do this without a NlgN (although very small N, not even
// the full rf)? Note also the distribution code below is N^2 anway // the full rf)? Note also the distribution code below is N^2 anyway
// (two nested for loops). // (two nested for loops).
std::list<std::pair<unsigned, float>> sorted_deficits; std::list<std::pair<unsigned, float>> sorted_deficits;
for (unsigned i = 0; i < rf; i++) { for (unsigned i = 0; i < rf; i++) {
@@ -393,7 +393,7 @@ redistribute(const std::vector<float>& p, unsigned me, unsigned k) {
// other nodes. Here we need to handle the opposite side - me is // other nodes. Here we need to handle the opposite side - me is
// one of the nodes which sent too much to other nodes and needs // one of the nodes which sent too much to other nodes and needs
// to send to the mixed node instead. // to send to the mixed node instead.
// TODO: find a more efficient way to check if the alorithm will // TODO: find a more efficient way to check if the algorithm will
// end with just one mixed node and its surplus :-( // end with just one mixed node and its surplus :-(
unsigned n_converted_to_deficit = 0; unsigned n_converted_to_deficit = 0;
unsigned mix_i = 0; // only used if n_converted_to_deficit==1 unsigned mix_i = 0; // only used if n_converted_to_deficit==1

View File

@@ -77,7 +77,7 @@ public:
if (_extra) { if (_extra) {
// Choose one of the remaining n-k nodes as the extra (k+1)th // Choose one of the remaining n-k nodes as the extra (k+1)th
// returned node. Currently, we choose the nodes with equal // returned node. Currently, we choose the nodes with equal
// probablities. We could have also used _pp or the original p // probabilities. We could have also used _pp or the original p
// for this - I don't know which is better, if it even matters. // for this - I don't know which is better, if it even matters.
std::vector<bool> used(n); std::vector<bool> used(n);
for (int i : r) { for (int i : r) {
@@ -115,7 +115,7 @@ miss_equalizing_combination(
} }
auto p = miss_equalizing_probablities(hit_rates); auto p = miss_equalizing_probablities(hit_rates);
// When we'll ask for combinations of "bf" different nodes, probabilities // When we'll ask for combinations of "bf" different nodes, probabilities
// higher than 1/bf cannot be achieved (1/bf itsef can be achieved by // higher than 1/bf cannot be achieved (1/bf itself can be achieved by
// returning this node in every returned combination). So no matter what // returning this node in every returned combination). So no matter what
// we do, we can't actually achieve the desired probabilities. Let's // we do, we can't actually achieve the desired probabilities. Let's
// try for the best we can // try for the best we can
@@ -125,7 +125,7 @@ miss_equalizing_combination(
hr_logger.trace("desired probabilities: {}, {}", node_hit_rate | boost::adaptors::map_keys, p); hr_logger.trace("desired probabilities: {}, {}", node_hit_rate | boost::adaptors::map_keys, p);
// If me >= rf, this node is NOT one of the replicas, and we just need // If me >= rf, this node is NOT one of the replicas, and we just need
// to use the probabilties for these replicas, without doing the // to use the probabilities for these replicas, without doing the
// redistribution to prefer the local replica. // redistribution to prefer the local replica.
if (me < rf) { if (me < rf) {
p = redistribute(p, me, bf); p = redistribute(p, me, bf);

View File

@@ -200,4 +200,4 @@ private:
}; };
} // namespace internal } // namespace internal
} // namesapce db::hints } // namespace db::hints

View File

@@ -233,7 +233,7 @@ private:
/// \return /// \return
const column_mapping& get_column_mapping(lw_shared_ptr<send_one_file_ctx> ctx_ptr, const frozen_mutation& fm, const hint_entry_reader& hr); const column_mapping& get_column_mapping(lw_shared_ptr<send_one_file_ctx> ctx_ptr, const frozen_mutation& fm, const hint_entry_reader& hr);
/// \brief Perform a single mutation send atempt. /// \brief Perform a single mutation send attempt.
/// ///
/// If the original destination end point is still a replica for the given mutation - send the mutation directly /// If the original destination end point is still a replica for the given mutation - send the mutation directly
/// to it, otherwise execute the mutation "from scratch" with CL=ALL. /// to it, otherwise execute the mutation "from scratch" with CL=ALL.

View File

@@ -165,10 +165,10 @@ public:
/// and which storing is not complete yet. This is meant to stabilize the memory consumption of the hints storing path /// and which storing is not complete yet. This is meant to stabilize the memory consumption of the hints storing path
/// which is initialed from the storage_proxy WRITE flow. storage_proxy is going to check this condition and if it /// which is initialed from the storage_proxy WRITE flow. storage_proxy is going to check this condition and if it
/// returns TRUE it won't attempt any new WRITEs thus eliminating the possibility of new hints generation. If new hints /// returns TRUE it won't attempt any new WRITEs thus eliminating the possibility of new hints generation. If new hints
/// are not generated the amount of in-flight hints amount and thus the memory they are consuming is going to drop eventualy /// are not generated the amount of in-flight hints amount and thus the memory they are consuming is going to drop eventually
/// because the hints are going to be either stored or dropped. After that the things are going to get back to normal again. /// because the hints are going to be either stored or dropped. After that the things are going to get back to normal again.
/// ///
/// Note that we can't consider the disk usage consumption here because the disk usage is not promissed to drop down shortly /// Note that we can't consider the disk usage consumption here because the disk usage is not promised to drop down shortly
/// because it requires the remote node to be UP. /// because it requires the remote node to be UP.
/// ///
/// \param ep end point to check /// \param ep end point to check

View File

@@ -41,7 +41,7 @@ namespace hints {
// per_manager_sync_point_v1 mv_sp - replay positions for materialized view hint queues // per_manager_sync_point_v1 mv_sp - replay positions for materialized view hint queues
// //
// per_manager_sync_point_v1: // per_manager_sync_point_v1:
// std::vector<gms::inet_address> addresses - adresses for which this sync point defines replay positions // std::vector<gms::inet_address> addresses - addresses for which this sync point defines replay positions
// std::vector<db::replay_position> flattened_rps: // std::vector<db::replay_position> flattened_rps:
// A flattened collection of replay positions for all addresses and shards. // A flattened collection of replay positions for all addresses and shards.
// Replay positions are grouped by address, in the same order as in // Replay positions are grouped by address, in the same order as in

View File

@@ -56,7 +56,7 @@ public:
typedef db_clock::time_point time_point; typedef db_clock::time_point time_point;
// TODO: we dont't support triggers. // TODO: we don't support triggers.
// this is a placeholder. // this is a placeholder.
struct trigger { struct trigger {
time_point timestamp; time_point timestamp;
@@ -448,7 +448,7 @@ public:
// TODO: Unfortunately there is not a single REGULAR column in system.schema_usertypes, so annoyingly we cannot // TODO: Unfortunately there is not a single REGULAR column in system.schema_usertypes, so annoyingly we cannot
// use the writeTime() CQL function, and must resort to a lower level. // use the writeTime() CQL function, and must resort to a lower level.
// Origin digs up the actual cells of target partition and gets timestamp from there. // Origin digs up the actual cells of target partition and gets timestamp from there.
// We should do the same, but g-dam thats messy. Lets give back dung value for now. // We should do the same, but g-dam that's messy. Lets give back dung value for now.
return make_ready_future<time_point>(dst.timestamp); return make_ready_future<time_point>(dst.timestamp);
} }

View File

@@ -15,7 +15,7 @@ namespace db {
enum class schema_feature { enum class schema_feature {
VIEW_VIRTUAL_COLUMNS, VIEW_VIRTUAL_COLUMNS,
// When set, the schema digest is calcualted in a way such that it doesn't change after all // When set, the schema digest is calculated in a way such that it doesn't change after all
// tombstones in an empty partition expire. // tombstones in an empty partition expire.
// See https://github.com/scylladb/scylla/issues/4485 // See https://github.com/scylladb/scylla/issues/4485
DIGEST_INSENSITIVE_TO_EXPIRY, DIGEST_INSENSITIVE_TO_EXPIRY,

View File

@@ -1460,7 +1460,7 @@ static future<> merge_tables_and_views(distributed<service::storage_proxy>& prox
// If we don't do it we are leaving a window where write commands to this schema are illegal. // If we don't do it we are leaving a window where write commands to this schema are illegal.
// There are 3 possibilities: // There are 3 possibilities:
// 1. The table was altered - in this case we want the view to correspond to this new table schema. // 1. The table was altered - in this case we want the view to correspond to this new table schema.
// 2. The table was just created - the table is guarantied to be published with the view in that case. // 2. The table was just created - the table is guaranteed to be published with the view in that case.
// 3. The view itself was altered - in that case we already know the base table so we can take it from // 3. The view itself was altered - in that case we already know the base table so we can take it from
// the database object. // the database object.
view_ptr vp = create_view_from_mutations(proxy, std::move(sm)); view_ptr vp = create_view_from_mutations(proxy, std::move(sm));
@@ -1519,7 +1519,7 @@ static future<> merge_tables_and_views(distributed<service::storage_proxy>& prox
co_await db.invoke_on_all([&] (replica::database& db) -> future<> { co_await db.invoke_on_all([&] (replica::database& db) -> future<> {
// In order to avoid possible races we first create the tables and only then the views. // In order to avoid possible races we first create the tables and only then the views.
// That way if a view seeks information about its base table it's guarantied to find it. // That way if a view seeks information about its base table it's guaranteed to find it.
co_await max_concurrent_for_each(tables_diff.created, max_concurrent, [&] (global_schema_ptr& gs) -> future<> { co_await max_concurrent_for_each(tables_diff.created, max_concurrent, [&] (global_schema_ptr& gs) -> future<> {
co_await db.add_column_family_and_make_directory(gs, replica::database::is_new_cf::yes); co_await db.add_column_family_and_make_directory(gs, replica::database::is_new_cf::yes);
}); });

View File

@@ -1906,7 +1906,7 @@ std::vector<schema_ptr> system_keyspace::all_tables(const db::config& cfg) {
} }
// legacy schema // legacy schema
r.insert(r.end(), { r.insert(r.end(), {
// TODO: once we migrate hints/batchlog and add convertor // TODO: once we migrate hints/batchlog and add converter
// legacy::hints(), legacy::batchlog(), // legacy::hints(), legacy::batchlog(),
legacy::keyspaces(), legacy::column_families(), legacy::keyspaces(), legacy::column_families(),
legacy::columns(), legacy::triggers(), legacy::usertypes(), legacy::columns(), legacy::triggers(), legacy::usertypes(),
@@ -2228,7 +2228,7 @@ future<service::paxos::paxos_state> system_keyspace::load_paxos_state(partition_
std::optional<service::paxos::proposal> most_recent; std::optional<service::paxos::proposal> most_recent;
if (row.has("most_recent_commit_at")) { if (row.has("most_recent_commit_at")) {
// the value can be missing if it was pruned, suply empty one since // the value can be missing if it was pruned, supply empty one since
// it will not going to be used anyway // it will not going to be used anyway
auto fm = row.has("most_recent_commit") ? auto fm = row.has("most_recent_commit") ?
ser::deserialize_from_buffer<>(row.get_blob("most_recent_commit"), boost::type<frozen_mutation>(), 0) : ser::deserialize_from_buffer<>(row.get_blob("most_recent_commit"), boost::type<frozen_mutation>(), 0) :
@@ -2539,7 +2539,7 @@ future<service::topology> system_keyspace::load_topology_state() {
ret.req_param.emplace(host_id, service::rebuild_param{*rebuild_option}); ret.req_param.emplace(host_id, service::rebuild_param{*rebuild_option});
break; break;
case service::node_state::left_token_ring: case service::node_state::left_token_ring:
// If replacenode fails the bootstraping node is moved to left_token_ring state where it executes the metadata // If replacenode fails the bootstrapping node is moved to left_token_ring state where it executes the metadata
// barrier. It needs to know which nodes to ignore during the barrier, so put them here into the replace_param. // barrier. It needs to know which nodes to ignore during the barrier, so put them here into the replace_param.
// Note that if the replacenode does not fail and later the node is decommissioned it will move to the left_token_ring // Note that if the replacenode does not fail and later the node is decommissioned it will move to the left_token_ring
// state at some point and replace_param will be created here as well (we do not remove replaced_id, and ignored_ids // state at some point and replace_param will be created here as well (we do not remove replaced_id, and ignored_ids

View File

@@ -212,7 +212,7 @@ db::view::base_info_ptr view_info::make_base_dependent_view_info(const schema& b
// If we didn't find the column in the base column then it must have been deleted // If we didn't find the column in the base column then it must have been deleted
// or not yet added (by alter command), this means it is for sure not a pk column // or not yet added (by alter command), this means it is for sure not a pk column
// in the base table. This can happen if the version of the base schema is not the // in the base table. This can happen if the version of the base schema is not the
// one that the view was created with. Seting this schema as the base can't harm since // one that the view was created with. Setting this schema as the base can't harm since
// if we got to such a situation then it means it is only going to be used for reading // if we got to such a situation then it means it is only going to be used for reading
// (computation of shadowable tombstones) and in that case the existence of such a column // (computation of shadowable tombstones) and in that case the existence of such a column
// is the only thing that is of interest to us. // is the only thing that is of interest to us.
@@ -289,7 +289,7 @@ bool partition_key_matches(data_dictionary::database db, const schema& base, con
uint64_t zero = 0; uint64_t zero = 0;
auto dummy_row = query::result_row_view(ser::qr_row_view{simple_memory_input_stream(reinterpret_cast<const char*>(&zero), 8)}); auto dummy_row = query::result_row_view(ser::qr_row_view{simple_memory_input_stream(reinterpret_cast<const char*>(&zero), 8)});
auto dummy_options = cql3::query_options({ }); auto dummy_options = cql3::query_options({ });
// FIXME: pass nullptrs for some of theses dummies // FIXME: pass nullptrs for some of these dummies
return cql3::expr::is_satisfied_by( return cql3::expr::is_satisfied_by(
pk_restrictions, pk_restrictions,
cql3::expr::evaluation_inputs{ cql3::expr::evaluation_inputs{
@@ -313,7 +313,7 @@ bool clustering_prefix_matches(data_dictionary::database db, const schema& base,
auto selection = cql3::selection::selection::for_columns(base.shared_from_this(), ck_columns); auto selection = cql3::selection::selection::for_columns(base.shared_from_this(), ck_columns);
uint64_t zero = 0; uint64_t zero = 0;
auto dummy_options = cql3::query_options({ }); auto dummy_options = cql3::query_options({ });
// FIXME: pass nullptrs for some of theses dummies // FIXME: pass nullptrs for some of dummies
return cql3::expr::is_satisfied_by( return cql3::expr::is_satisfied_by(
r, r,
cql3::expr::evaluation_inputs{ cql3::expr::evaluation_inputs{
@@ -1664,7 +1664,7 @@ future<> view_update_generator::mutate_MV(
} }
} }
} }
// It's still possible that a target endpoint is dupliated in the remote endpoints list, // It's still possible that a target endpoint is duplicated in the remote endpoints list,
// so let's get rid of the duplicate if it exists // so let's get rid of the duplicate if it exists
if (target_endpoint) { if (target_endpoint) {
auto remote_it = std::find(remote_endpoints.begin(), remote_endpoints.end(), *target_endpoint); auto remote_it = std::find(remote_endpoints.begin(), remote_endpoints.end(), *target_endpoint);

View File

@@ -296,7 +296,7 @@ void view_update_generator::discover_staging_sstables() {
_progress_tracker->on_sstable_registration(sst); _progress_tracker->on_sstable_registration(sst);
_sstables_with_tables[t].push_back(std::move(sst)); _sstables_with_tables[t].push_back(std::move(sst));
// we're at early stage here, no need to kick _pending_sstables (the // we're at early stage here, no need to kick _pending_sstables (the
// bulding fiber is not running), neither we can wait on the semaphore // building fiber is not running), neither we can wait on the semaphore
_registration_sem.consume(1); _registration_sem.consume(1);
} }
} }

View File

@@ -21,7 +21,7 @@ namespace dht {
// allowed anyway. However, they *are* allowed in materialized views, so the // allowed anyway. However, they *are* allowed in materialized views, so the
// empty-key partition should get a real token, not an invalid token, so // empty-key partition should get a real token, not an invalid token, so
// we dropped this special case. Since we don't support migrating sstables of // we dropped this special case. Since we don't support migrating sstables of
// materialized-views from Cassandra, this Cassandra-Scylla incompatiblity // materialized-views from Cassandra, this Cassandra-Scylla incompatibility
// will not cause problems in practice. // will not cause problems in practice.
// Note that get_token(const schema& s, partition_key_view key) below must // Note that get_token(const schema& s, partition_key_view key) below must
// use exactly the same algorithm as this function. // use exactly the same algorithm as this function.

View File

@@ -128,7 +128,7 @@ WantedBy=local-fs.target scylla-server.service
# Not just available/unavailable, it describe more: # Not just available/unavailable, it describe more:
# - Storage: none # - Storage: none
# - Storage: journal # - Storage: journal
# - Storage: /path/to/file (inacessible) # - Storage: /path/to/file (inaccessible)
# - Storage: /path/to/file # - Storage: /path/to/file
# #
# After systemd-v248, available coredump file output changed like this: # After systemd-v248, available coredump file output changed like this:

View File

@@ -103,7 +103,7 @@ deb-src http://security.debian.org/ $SUITE/updates main contrib non-free
EOS EOS
fi fi
sudo wget -P build/chroot/etc/apt/sources.list.d $REPO sudo wget -P build/chroot/etc/apt/sources.list.d $REPO
# Avoid the pacakges to be deleted after installation # Avoid the packages to be deleted after installation
sudo tee build/chroot/etc/apt/apt.conf.d/01keep-debs << EOS sudo tee build/chroot/etc/apt/apt.conf.d/01keep-debs << EOS
Binary::apt::APT::Keep-Downloaded-Packages "true"; Binary::apt::APT::Keep-Downloaded-Packages "true";
EOS EOS

View File

@@ -253,4 +253,4 @@ fi
%changelog %changelog
* Tue Jul 21 2015 Takuya ASADA <syuu@cloudius-systems.com> * Tue Jul 21 2015 Takuya ASADA <syuu@cloudius-systems.com>
- inital version of scylla.spec - initial version of scylla.spec

View File

@@ -108,7 +108,7 @@ public:
// bigger than this hard_limit. To clean things up, we introduced the third // bigger than this hard_limit. To clean things up, we introduced the third
// field into max_result_size. It's name is page_size. Now page_size always // field into max_result_size. It's name is page_size. Now page_size always
// means the size of the page while soft and hard limits are just what their // means the size of the page while soft and hard limits are just what their
// names suggest. They are no longer interepreted as page size. This is not // names suggest. They are no longer interpreted as page size. This is not
// a backwards compatible change so this new cluster feature is used to make // a backwards compatible change so this new cluster feature is used to make
// sure the whole cluster supports the new page_size field and we can safely // sure the whole cluster supports the new page_size field and we can safely
// send it to replicas. // send it to replicas.

View File

@@ -190,7 +190,7 @@ future<> gossiper::handle_syn_msg(msg_addr from, gossip_digest_syn syn_msg) {
syn_msg_pending& p = _syn_handlers[from.addr]; syn_msg_pending& p = _syn_handlers[from.addr];
if (p.pending) { if (p.pending) {
// The latest syn message from peer has the latest infomation, so // The latest syn message from peer has the latest information, so
// it is safe to drop the previous syn message and keep the latest // it is safe to drop the previous syn message and keep the latest
// one only. // one only.
logger.debug("Queue gossip syn msg from node {}, syn_msg={}", from, syn_msg); logger.debug("Queue gossip syn msg from node {}, syn_msg={}", from, syn_msg);
@@ -307,7 +307,7 @@ future<> gossiper::handle_ack_msg(msg_addr id, gossip_digest_ack ack_msg) {
} }
ack_msg_pending& p = _ack_handlers[from.addr]; ack_msg_pending& p = _ack_handlers[from.addr];
if (p.pending) { if (p.pending) {
// The latest ack message digests from peer has the latest infomation, so // The latest ack message digests from peer has the latest information, so
// it is safe to drop the previous ack message digests and keep the latest // it is safe to drop the previous ack message digests and keep the latest
// one only. // one only.
logger.debug("Queue gossip ack msg digests from node {}, ack_msg_digest={}", from, ack_msg_digest); logger.debug("Queue gossip ack msg digests from node {}, ack_msg_digest={}", from, ack_msg_digest);
@@ -365,7 +365,7 @@ future<> gossiper::do_send_ack2_msg(msg_addr from, utils::chunked_vector<gossip_
// Local generation for addr may have been increased since the // Local generation for addr may have been increased since the
// current node sent an initial SYN. Comparing versions across // current node sent an initial SYN. Comparing versions across
// different generations in get_state_for_version_bigger_than // different generations in get_state_for_version_bigger_than
// could result in loosing some app states with smaller versions. // could result in losing some app states with smaller versions.
const auto version = es->get_heart_beat_state().get_generation() > g_digest.get_generation() const auto version = es->get_heart_beat_state().get_generation() > g_digest.get_generation()
? version_type(0) ? version_type(0)
: g_digest.get_max_version(); : g_digest.get_max_version();
@@ -1858,7 +1858,7 @@ future<> gossiper::do_on_dead_notifications(inet_address addr, endpoint_state_pt
void gossiper::request_all(gossip_digest& g_digest, void gossiper::request_all(gossip_digest& g_digest,
utils::chunked_vector<gossip_digest>& delta_gossip_digest_list, generation_type remote_generation) const { utils::chunked_vector<gossip_digest>& delta_gossip_digest_list, generation_type remote_generation) const {
/* We are here since we have no data for this endpoint locally so request everthing. */ /* We are here since we have no data for this endpoint locally so request everything. */
delta_gossip_digest_list.emplace_back(g_digest.get_endpoint(), remote_generation); delta_gossip_digest_list.emplace_back(g_digest.get_endpoint(), remote_generation);
logger.trace("request_all for {}", g_digest.get_endpoint()); logger.trace("request_all for {}", g_digest.get_endpoint());
} }
@@ -2128,7 +2128,7 @@ future<> gossiper::add_local_application_state(std::initializer_list<std::pair<a
// we overwrite the version to ensure the set is monotonic. However, it does not break anything, // we overwrite the version to ensure the set is monotonic. However, it does not break anything,
// and changing this tends to spread widely (see versioned_value::factory), so that can be its own // and changing this tends to spread widely (see versioned_value::factory), so that can be its own
// change later, if needed. // change later, if needed.
// Retaining the slightly broken signature is also cosistent with origin. Hooray. // Retaining the slightly broken signature is also consistent with origin. Hooray.
// //
future<> gossiper::add_local_application_state(std::list<std::pair<application_state, versioned_value>> states) { future<> gossiper::add_local_application_state(std::list<std::pair<application_state, versioned_value>> states) {
if (states.empty()) { if (states.empty()) {

View File

@@ -204,7 +204,7 @@ public:
static constexpr std::chrono::milliseconds GOSSIP_SETTLE_MIN_WAIT_MS{5000}; static constexpr std::chrono::milliseconds GOSSIP_SETTLE_MIN_WAIT_MS{5000};
// Maximimum difference between remote generation value and generation // Maximum difference between remote generation value and generation
// value this node would get if this node were restarted that we are // value this node would get if this node were restarted that we are
// willing to accept about a peer. // willing to accept about a peer.
static constexpr generation_type::value_type MAX_GENERATION_DIFFERENCE = 86400 * 365; static constexpr generation_type::value_type MAX_GENERATION_DIFFERENCE = 86400 * 365;

View File

@@ -25,7 +25,7 @@ namespace gms {
* instance to decide what he does with this change. Not all modules maybe interested * instance to decide what he does with this change. Not all modules maybe interested
* in all state changes. * in all state changes.
* *
* All notificaions that accept a permit_id are guaranteed to be called * All notifications that accept a permit_id are guaranteed to be called
* under the respective endpoint lock. The permit_id must be provided * under the respective endpoint lock. The permit_id must be provided
* by the subscriber if it calls back gossiper functions that modify the same endpoint's * by the subscriber if it calls back gossiper functions that modify the same endpoint's
* state, and therefore may acquire the same endpoint_lock - to prevent deadlock on the nested * state, and therefore may acquire the same endpoint_lock - to prevent deadlock on the nested

View File

@@ -93,7 +93,7 @@ struct fmt::formatter<gms::inet_address> : fmt::formatter<std::string_view> {
if (x.addr().is_ipv4()) { if (x.addr().is_ipv4()) {
return fmt::format_to(ctx.out(), "{}", x.addr()); return fmt::format_to(ctx.out(), "{}", x.addr());
} }
// print 2 bytes in a group, and use ':' as the delimeter // print 2 bytes in a group, and use ':' as the delimiter
fmt::format_to(ctx.out(), "{:2:}", fmt_hex(x.bytes())); fmt::format_to(ctx.out(), "{:2:}", fmt_hex(x.bytes()));
if (x.addr().scope() != seastar::net::inet_address::invalid_scope) { if (x.addr().scope() != seastar::net::inet_address::invalid_scope) {
return fmt::format_to(ctx.out(), "%{}", x.addr().scope()); return fmt::format_to(ctx.out(), "%{}", x.addr().scope());

View File

@@ -261,7 +261,7 @@ view_ptr secondary_index_manager::create_view_for_index(const index_metadata& im
if (!im.local()) { if (!im.local()) {
// If two cells within the same collection share the same value but not liveness information, then // If two cells within the same collection share the same value but not liveness information, then
// for the index on the values, the rows generated would share the same primary key and thus the // for the index on the values, the rows generated would share the same primary key and thus the
// liveness information as well. Prevent that by distinguising them in the clustering key. // liveness information as well. Prevent that by distinguishing them in the clustering key.
if (target_type == cql3::statements::index_target::target_type::collection_values) { if (target_type == cql3::statements::index_target::target_type::collection_values) {
data_type t = type_for_computed_column(cql3::statements::index_target::target_type::keys, *index_target->type); data_type t = type_for_computed_column(cql3::statements::index_target::target_type::keys, *index_target->type);
bytes column_name = get_available_column_name(*schema, "keys_for_values_idx"); bytes column_name = get_available_column_name(*schema, "keys_for_values_idx");

View File

@@ -703,7 +703,7 @@ service Cassandra {
/** /**
* Atomic compare and set. * Atomic compare and set.
* *
* If the cas is successfull, the success boolean in CASResult will be true and there will be no current_values. * If the cas is successful, the success boolean in CASResult will be true and there will be no current_values.
* Otherwise, success will be false and current_values will contain the current values for the columns in * Otherwise, success will be false and current_values will contain the current values for the columns in
* expected (that, by definition of compare-and-set, will differ from the values in expected). * expected (that, by definition of compare-and-set, will differ from the values in expected).
* *
@@ -845,7 +845,7 @@ service Cassandra {
throws (1:InvalidRequestException ire), throws (1:InvalidRequestException ire),
/** Enables tracing for the next query in this connection and returns the UUID for that trace session /** Enables tracing for the next query in this connection and returns the UUID for that trace session
The next query will be traced idependently of trace probability and the returned UUID can be used to query the trace keyspace */ The next query will be traced independently of trace probability and the returned UUID can be used to query the trace keyspace */
binary trace_next_query(), binary trace_next_query(),
list<CfSplit> describe_splits_ex(1:required string cfName, list<CfSplit> describe_splits_ex(1:required string cfName,

View File

@@ -23,7 +23,7 @@ public:
virtual void validate_options(const gms::feature_service&) const override { /* noop */ } virtual void validate_options(const gms::feature_service&) const override { /* noop */ }
std::optional<std::unordered_set<sstring>> recognized_options(const topology&) const override { std::optional<std::unordered_set<sstring>> recognized_options(const topology&) const override {
// We explicitely allow all options // We explicitly allow all options
return std::nullopt; return std::nullopt;
} }

View File

@@ -134,7 +134,7 @@ public:
return snitch_signal_connection_t(); return snitch_signal_connection_t();
} }
// tells wheter the INTERNAL_IP address should be preferred over endpoint address // tells whether the INTERNAL_IP address should be preferred over endpoint address
virtual bool prefer_local() const noexcept { virtual bool prefer_local() const noexcept {
return false; return false;
} }

View File

@@ -692,7 +692,7 @@ messaging_service::get_rpc_client_idx(messaging_verb verb) const {
const auto curr_sched_group = current_scheduling_group(); const auto curr_sched_group = current_scheduling_group();
for (unsigned i = 0; i < _connection_index_for_tenant.size(); ++i) { for (unsigned i = 0; i < _connection_index_for_tenant.size(); ++i) {
if (_connection_index_for_tenant[i].sched_group == curr_sched_group) { if (_connection_index_for_tenant[i].sched_group == curr_sched_group) {
// i == 0: the default tenant maps to the default client indexes beloning to the interval // i == 0: the default tenant maps to the default client indexes belonging to the interval
// [PER_SHARD_CONNECTION_COUNT, PER_SHARD_CONNECTION_COUNT + PER_TENANT_CONNECTION_COUNT). // [PER_SHARD_CONNECTION_COUNT, PER_SHARD_CONNECTION_COUNT + PER_TENANT_CONNECTION_COUNT).
idx += i * PER_TENANT_CONNECTION_COUNT; idx += i * PER_TENANT_CONNECTION_COUNT;
break; break;

View File

@@ -362,10 +362,10 @@ public:
// Strong exception guarantees. // Strong exception guarantees.
position_in_partition& operator=(position_in_partition_view view) { position_in_partition& operator=(position_in_partition_view view) {
// The copy assigment to _ck can throw (because it allocates), // The copy assignment to _ck can throw (because it allocates),
// but assignments to _type and _bound_weight can't throw. // but assignments to _type and _bound_weight can't throw.
// Thus, to achieve strong exception guarantees, // Thus, to achieve strong exception guarantees,
// we only need to perform the _ck assigmnent before others. // we only need to perform the _ck assignment before others.
if (view._ck) { if (view._ck) {
_ck = *view._ck; _ck = *view._ck;
} else { } else {

View File

@@ -224,7 +224,7 @@ struct appending_hash<range_tombstone> {
// follow the ordering used by the mutation readers. // follow the ordering used by the mutation readers.
// //
// Unless the accumulator is in the reverse mode, after apply(rt) or // Unless the accumulator is in the reverse mode, after apply(rt) or
// tombstone_for_row(ck) are called there are followng restrictions for // tombstone_for_row(ck) are called there are following restrictions for
// subsequent calls: // subsequent calls:
// - apply(rt1) can be invoked only if rt.start_bound() < rt1.start_bound() // - apply(rt1) can be invoked only if rt.start_bound() < rt1.start_bound()
// and ck < rt1.start_bound() // and ck < rt1.start_bound()

View File

@@ -51,7 +51,7 @@ namely:
A complete description of expected semantics and guarantees A complete description of expected semantics and guarantees
is maintained in the comments for these classes and in sample is maintained in the comments for these classes and in sample
implementations. Let's list here key aspects the implementor should implementations. Let's list here key aspects the implementer should
bear in mind: bear in mind:
- RPC should implement a model of asynchronous, unreliable network, - RPC should implement a model of asynchronous, unreliable network,
in which messages can be lost, reordered, retransmitted more than in which messages can be lost, reordered, retransmitted more than
@@ -261,7 +261,7 @@ to truncate Raft log length afterwards, or when the snapshot
transfer from the leader is initiated via `rpc::send_snapshot()`. transfer from the leader is initiated via `rpc::send_snapshot()`.
In the latter case the leader's state machine is expected In the latter case the leader's state machine is expected
to contact the follower's state machine and send its snaphsot to to contact the follower's state machine and send its snapshot to
it. it.
When Raft wants to initialize a state machine with a snapshot When Raft wants to initialize a state machine with a snapshot

View File

@@ -210,7 +210,7 @@ void fsm::become_candidate(bool is_prevote, bool is_leadership_transfer) {
if (!std::holds_alternative<candidate>(_state)) { if (!std::holds_alternative<candidate>(_state)) {
_output.state_changed = true; _output.state_changed = true;
} }
// When starting a campain we need to reset current leader otherwise // When starting a campaign we need to reset current leader otherwise
// disruptive server prevention will stall an election if quorum of nodes // disruptive server prevention will stall an election if quorum of nodes
// start election together since each one will ignore vote requests from others // start election together since each one will ignore vote requests from others
@@ -402,7 +402,7 @@ fsm_output fsm::get_output() {
// We advance stable index before the entries are // We advance stable index before the entries are
// actually persisted, because if writing to stable storage // actually persisted, because if writing to stable storage
// will fail the FSM will be stopped and get_output() will // will fail the FSM will be stopped and get_output() will
// never be called again, so any new sate that assumes that // never be called again, so any new state that assumes that
// the entries are stable will not be observed. // the entries are stable will not be observed.
advance_stable_idx(output.log_entries.back()->idx); advance_stable_idx(output.log_entries.back()->idx);
} }
@@ -737,7 +737,7 @@ void fsm::append_entries_reply(server_id from, append_reply&& reply) {
_my_id, from, progress.match_idx, rejected.non_matching_idx); _my_id, from, progress.match_idx, rejected.non_matching_idx);
// If non_matching_idx and last_idx are zero it means that a follower is looking for a leader // If non_matching_idx and last_idx are zero it means that a follower is looking for a leader
// as such message cannot be a result of real missmatch. // as such message cannot be a result of real mismatch.
// Send an empty append message to notify it that we are the leader // Send an empty append message to notify it that we are the leader
if (rejected.non_matching_idx == index_t{0} && rejected.last_idx == index_t{0}) { if (rejected.non_matching_idx == index_t{0} && rejected.last_idx == index_t{0}) {
logger.trace("append_entries_reply[{}->{}]: send empty append message", _my_id, from); logger.trace("append_entries_reply[{}->{}]: send empty append message", _my_id, from);

View File

@@ -533,7 +533,7 @@ static constexpr logical_clock::duration ELECTION_TIMEOUT = logical_clock::durat
// rpc, persistence and state_machine classes will have to be implemented by the // rpc, persistence and state_machine classes will have to be implemented by the
// raft user to provide network, persistency and busyness logic support // raft user to provide network, persistency and busyness logic support
// repectively. // respectively.
class rpc; class rpc;
class persistence; class persistence;
@@ -553,7 +553,7 @@ public:
// more than one entry all of them will be committed simultaneously. // more than one entry all of them will be committed simultaneously.
// Will be eventually called on all replicas, for all committed commands. // Will be eventually called on all replicas, for all committed commands.
// Raft owns the data since it may be still replicating. // Raft owns the data since it may be still replicating.
// Raft will not call another apply until the retuned future // Raft will not call another apply until the returned future
// will not become ready. // will not become ready.
virtual future<> apply(std::vector<command_cref> command) = 0; virtual future<> apply(std::vector<command_cref> command) = 0;

View File

@@ -1202,7 +1202,7 @@ future<> server_impl::applier_fiber() {
// Completion notification code assumes that previous snapshot is applied // Completion notification code assumes that previous snapshot is applied
// before new entries are committed, otherwise it asserts that some // before new entries are committed, otherwise it asserts that some
// notifications were missing. To prevent a committed entry to // notifications were missing. To prevent a committed entry to
// be notified before an erlier snapshot is applied do both // be notified before an earlier snapshot is applied do both
// notification and snapshot application in the same fiber // notification and snapshot application in the same fiber
notify_waiters(_awaited_commits, batch); notify_waiters(_awaited_commits, batch);

View File

@@ -49,7 +49,7 @@ public:
// If set to true will enable prevoting stage during election // If set to true will enable prevoting stage during election
bool enable_prevoting = true; bool enable_prevoting = true;
// If set to true, forward configuration and entries from // If set to true, forward configuration and entries from
// follower to the leader autmatically. This guarantees // follower to the leader automatically. This guarantees
// add_entry()/modify_config() never throws not_a_leader, // add_entry()/modify_config() never throws not_a_leader,
// but makes timed_out_error more likely. // but makes timed_out_error more likely.
bool enable_forwarding = true; bool enable_forwarding = true;
@@ -242,7 +242,7 @@ public:
virtual void tick() = 0; virtual void tick() = 0;
// Returned future is resolved when state changes // Returned future is resolved when state changes
// State changes can be coalesced, so it is not guarantied that the caller will // State changes can be coalesced, so it is not guaranteed that the caller will
// get notification about each one of them. The state can even be the same after // get notification about each one of them. The state can even be the same after
// the call as before, but term should be different. // the call as before, but term should be different.
virtual future<> wait_for_state_change(seastar::abort_source* as = nullptr) = 0; virtual future<> wait_for_state_change(seastar::abort_source* as = nullptr) = 0;

View File

@@ -91,10 +91,10 @@ bool follower_progress::can_send_to() {
} }
// If this is called when a tracker is just created, the current // If this is called when a tracker is just created, the current
// progress is empty and we should simply crate an instance for // progress is empty and we should simply create an instance for
// each follower. // each follower.
// When switching configurations, we should preserve progress // When switching configurations, we should preserve progress
// for existing followers, crate progress for new, and remove // for existing followers, create progress for new, and remove
// progress for non-members (to make sure we don't send noise // progress for non-members (to make sure we don't send noise
// messages to them). // messages to them).
void tracker::set_configuration(const configuration& configuration, index_t next_idx) { void tracker::set_configuration(const configuration& configuration, index_t next_idx) {

View File

@@ -38,7 +38,7 @@ public:
PROBE, PROBE,
// In this state multiple append entries are sent optimistically // In this state multiple append entries are sent optimistically
PIPELINE, PIPELINE,
// In this state snapshot is been transfered // In this state snapshot is been transferred
SNAPSHOT SNAPSHOT
}; };
state state = state::PROBE; state state = state::PROBE;

View File

@@ -409,7 +409,7 @@ future<mutation_reader_merger::needs_merge> mutation_reader_merger::prepare_one(
// end-of-stream to know what readers to ff. We can't // end-of-stream to know what readers to ff. We can't
// just ff all readers as we might drop fragments from // just ff all readers as we might drop fragments from
// partitions we haven't even read yet. // partitions we haven't even read yet.
// Readers whoose last emitted fragment was a partition // Readers whose last emitted fragment was a partition
// end are out of data for good for the current range. // end are out of data for good for the current range.
_halted_readers.push_back(rk); _halted_readers.push_back(rk);
} else if (_fwd_mr == mutation_reader::forwarding::no) { } else if (_fwd_mr == mutation_reader::forwarding::no) {

View File

@@ -506,7 +506,7 @@ public:
} }
// Changes the range of partitions to pr. The range can only be moved // Changes the range of partitions to pr. The range can only be moved
// forwards. pr.begin() needs to be larger than pr.end() of the previousl // forwards. pr.begin() needs to be larger than pr.end() of the previously
// used range (i.e. either the initial one passed to the constructor or a // used range (i.e. either the initial one passed to the constructor or a
// previous fast forward target). // previous fast forward target).
// pr needs to be valid until the reader is destroyed or fast_forward_to() // pr needs to be valid until the reader is destroyed or fast_forward_to()
@@ -553,8 +553,8 @@ public:
future<> close() noexcept { future<> close() noexcept {
if (auto i = std::move(_impl)) { if (auto i = std::move(_impl)) {
auto f = i->close(); auto f = i->close();
// most close implementations are expexcted to return a ready future // most close implementations are expected to return a ready future
// so expedite prcessing it. // so expedite processing it.
if (f.available() && !f.failed()) { if (f.available() && !f.failed()) {
return f; return f;
} }
@@ -602,7 +602,7 @@ public:
// Cannot be called if is_buffer_empty() returns true. // Cannot be called if is_buffer_empty() returns true.
const mutation_fragment_v2& peek_buffer() const { return _impl->_buffer.front(); } const mutation_fragment_v2& peek_buffer() const { return _impl->_buffer.front(); }
// The actual buffer size of the reader. // The actual buffer size of the reader.
// Altough we consistently refer to this as buffer size throught the code // Although we consistently refer to this as buffer size throught the code
// we really use "buffer size" as the size of the collective memory // we really use "buffer size" as the size of the collective memory
// used by all the mutation fragments stored in the buffer of the reader. // used by all the mutation fragments stored in the buffer of the reader.
size_t buffer_size() const { size_t buffer_size() const {
@@ -753,7 +753,7 @@ future<> consume_partitions(flat_mutation_reader_v2& reader, Consumer consumer)
}); });
} }
/// A cosumer function that is passed a flat_mutation_reader to be consumed from /// A consumer function that is passed a flat_mutation_reader to be consumed from
/// and returns a future<> resolved when the reader is fully consumed, and closed. /// and returns a future<> resolved when the reader is fully consumed, and closed.
/// Note: the function assumes ownership of the reader and must close it in all cases. /// Note: the function assumes ownership of the reader and must close it in all cases.
using reader_consumer_v2 = noncopyable_function<future<> (flat_mutation_reader_v2)>; using reader_consumer_v2 = noncopyable_function<future<> (flat_mutation_reader_v2)>;

View File

@@ -605,8 +605,8 @@ future<> evictable_reader_v2::fill_buffer() {
auto* next_mf = co_await _reader->peek(); auto* next_mf = co_await _reader->peek();
// First make sure we've made progress w.r.t. _next_position_in_partition. // First make sure we've made progress w.r.t. _next_position_in_partition.
// This loop becomes inifinite when next pos is a partition start. // This loop becomes infinite when next pos is a partition start.
// In that case progress is guranteed anyway, so skip this loop entirely. // In that case progress is guaranteed anyway, so skip this loop entirely.
while (!_next_position_in_partition.is_partition_start() && next_mf && _tri_cmp(buffer().back().position(), _next_position_in_partition) <= 0) { while (!_next_position_in_partition.is_partition_start() && next_mf && _tri_cmp(buffer().back().position(), _next_position_in_partition) <= 0) {
push_mutation_fragment(_reader->pop_mutation_fragment()); push_mutation_fragment(_reader->pop_mutation_fragment());
next_mf = co_await _reader->peek(); next_mf = co_await _reader->peek();

View File

@@ -71,7 +71,7 @@ public:
struct repair_uniq_id { struct repair_uniq_id {
// The integer ID used to identify a repair job. It is currently used by nodetool and http API. // The integer ID used to identify a repair job. It is currently used by nodetool and http API.
int id; int id;
// Task info containing a UUID to identifiy a repair job, and a shard of the job. // Task info containing a UUID to identify a repair job, and a shard of the job.
// We will transit to use UUID over the integer ID. // We will transit to use UUID over the integer ID.
tasks::task_info task_info; tasks::task_info task_info;

View File

@@ -1235,7 +1235,7 @@ private:
// Delete the rows > _current_sync_boundary from _row_buf // Delete the rows > _current_sync_boundary from _row_buf
// Swap _working_row_buf and _row_buf so that _working_row_buf // Swap _working_row_buf and _row_buf so that _working_row_buf
// contains rows within (_last_sync_boundary, // contains rows within (_last_sync_boundary,
// _current_sync_boundary], _row_buf contains rows wthin // _current_sync_boundary], _row_buf contains rows within
// (_current_sync_boundary, ...] // (_current_sync_boundary, ...]
repair_row& r = *it; repair_row& r = *it;
if (_cmp(r.boundary(), *_current_sync_boundary) <= 0) { if (_cmp(r.boundary(), *_current_sync_boundary) <= 0) {
@@ -1536,7 +1536,7 @@ public:
future<get_combined_row_hash_response> future<get_combined_row_hash_response>
get_combined_row_hash_handler(std::optional<repair_sync_boundary> common_sync_boundary) { get_combined_row_hash_handler(std::optional<repair_sync_boundary> common_sync_boundary) {
// We can not call this function twice. The good thing is we do not use // We can not call this function twice. The good thing is we do not use
// retransmission at messaging_service level, so no message will be retransmited. // retransmission at messaging_service level, so no message will be retransmitted.
rlogger.trace("Calling get_combined_row_hash_handler"); rlogger.trace("Calling get_combined_row_hash_handler");
return with_gate(_gate, [this, common_sync_boundary = std::move(common_sync_boundary)] () mutable { return with_gate(_gate, [this, common_sync_boundary = std::move(common_sync_boundary)] () mutable {
_cf.update_off_strategy_trigger(); _cf.update_off_strategy_trigger();

View File

@@ -2257,7 +2257,7 @@ database::make_keyspace_config(const keyspace_metadata& ksm) {
cfg.all_datadirs.push_back(format("{}/{}", extra, ksm.name())); cfg.all_datadirs.push_back(format("{}/{}", extra, ksm.name()));
} }
cfg.enable_disk_writes = !_cfg.enable_in_memory_data_store(); cfg.enable_disk_writes = !_cfg.enable_in_memory_data_store();
cfg.enable_disk_reads = true; // we allways read from disk cfg.enable_disk_reads = true; // we always read from disk
cfg.enable_commitlog = _cfg.enable_commitlog() && !_cfg.enable_in_memory_data_store(); cfg.enable_commitlog = _cfg.enable_commitlog() && !_cfg.enable_in_memory_data_store();
cfg.enable_cache = _cfg.enable_cache(); cfg.enable_cache = _cfg.enable_cache();

View File

@@ -714,7 +714,7 @@ public:
lw_shared_ptr<sstables::sstable_set> sstables, gc_clock::time_point compaction_time) const; lw_shared_ptr<sstables::sstable_set> sstables, gc_clock::time_point compaction_time) const;
// Make a reader which reads only from the row-cache. // Make a reader which reads only from the row-cache.
// The reader doens't populate the cache, it reads only what is in the cache // The reader doesn't populate the cache, it reads only what is in the cache
// Supports reading only a single partition. // Supports reading only a single partition.
// Does not support reading in reverse. // Does not support reading in reverse.
flat_mutation_reader_v2 make_nonpopulating_cache_reader(schema_ptr schema, reader_permit permit, const dht::partition_range& range, flat_mutation_reader_v2 make_nonpopulating_cache_reader(schema_ptr schema, reader_permit permit, const dht::partition_range& range,
@@ -1166,10 +1166,10 @@ public:
// Returns true iff sst was found and erased. // Returns true iff sst was found and erased.
bool erase_sstable_cleanup_state(const sstables::shared_sstable& sst); bool erase_sstable_cleanup_state(const sstables::shared_sstable& sst);
// Returns true if the sstable requries cleanup. // Returns true if the sstable requires cleanup.
bool requires_cleanup(const sstables::shared_sstable& sst) const; bool requires_cleanup(const sstables::shared_sstable& sst) const;
// Returns true if any of the sstables requries cleanup. // Returns true if any of the sstables requires cleanup.
bool requires_cleanup(const sstables::sstable_set& set) const; bool requires_cleanup(const sstables::sstable_set& set) const;
// Takes snapshot of current storage state (includes memtable and sstables) from // Takes snapshot of current storage state (includes memtable and sstables) from

View File

@@ -69,7 +69,7 @@ public:
// //
// These callbacks will be called when the dirty memory manager // These callbacks will be called when the dirty memory manager
// see relevant changes in the memory pressure conditions for this region_group. By specializing // see relevant changes in the memory pressure conditions for this region_group. By specializing
// those methods - which are a nop by default - the callers initiate memtable flusing to // those methods - which are a nop by default - the callers initiate memtable flushing to
// free real and unspooled memory. // free real and unspooled memory.
// The following restrictions apply to implementations of start_reclaiming() and stop_reclaiming(): // The following restrictions apply to implementations of start_reclaiming() and stop_reclaiming():

View File

@@ -213,7 +213,7 @@ distributed_loader::process_upload_dir(distributed<replica::database>& db, distr
}; };
// Pass owned_ranges_ptr to reshard to piggy-back cleanup on the resharding compaction. // Pass owned_ranges_ptr to reshard to piggy-back cleanup on the resharding compaction.
// Note that needs_cleanup() is inaccurate and may return false positives, // Note that needs_cleanup() is inaccurate and may return false positives,
// maybe triggerring resharding+cleanup unnecessarily for some sstables. // maybe triggering resharding+cleanup unnecessarily for some sstables.
// But this is resharding on refresh (sstable loading via upload dir), // But this is resharding on refresh (sstable loading via upload dir),
// which will usually require resharding anyway. // which will usually require resharding anyway.
// //

View File

@@ -1214,7 +1214,7 @@ table::sstable_list_builder::build_new_list(const sstables::sstable_set& current
// this might seem dangerous, but "move" here just avoids constness, // this might seem dangerous, but "move" here just avoids constness,
// making the two ranges compatible when compiling with boost 1.55. // making the two ranges compatible when compiling with boost 1.55.
// Noone is actually moving anything... // No one is actually moving anything...
for (auto all = current_sstables.all(); auto&& tab : boost::range::join(new_sstables, std::move(*all))) { for (auto all = current_sstables.all(); auto&& tab : boost::range::join(new_sstables, std::move(*all))) {
if (!s.contains(tab)) { if (!s.contains(tab)) {
new_sstable_list.insert(tab); new_sstable_list.insert(tab);

View File

@@ -1115,7 +1115,7 @@ schema_builder& schema_builder::with_column_ordered(const column_definition& c)
} }
schema_builder& schema_builder::with_column(bytes name, data_type type, column_kind kind, column_view_virtual is_view_virtual) { schema_builder& schema_builder::with_column(bytes name, data_type type, column_kind kind, column_view_virtual is_view_virtual) {
// component_index will be determined by schema cosntructor // component_index will be determined by schema constructor
return with_column(name, type, kind, 0, is_view_virtual); return with_column(name, type, kind, 0, is_view_virtual);
} }

View File

@@ -55,7 +55,7 @@ using column_count_type = uint32_t;
using column_id = column_count_type; using column_id = column_count_type;
// Column ID unique within a schema. Enum class to avoid // Column ID unique within a schema. Enum class to avoid
// mixing wtih column id. // mixing with column id.
enum class ordinal_column_id: column_count_type {}; enum class ordinal_column_id: column_count_type {};
std::ostream& operator<<(std::ostream& os, ordinal_column_id id); std::ostream& operator<<(std::ostream& os, ordinal_column_id id);
@@ -536,10 +536,10 @@ class partition_slice;
* *
* Code using a particular extension can locate it by name in the schema map, * Code using a particular extension can locate it by name in the schema map,
* and barring the "is_placeholder" says true, cast it to whatever might * and barring the "is_placeholder" says true, cast it to whatever might
* be the expeceted implementation. * be the expected implementation.
* *
* We allow placeholder object since an extension written to schema tables * We allow placeholder object since an extension written to schema tables
* might be unavailable on next boot/other node. To avoid loosing the config data, * might be unavailable on next boot/other node. To avoid losing the config data,
* a placeholder object is put into schema map, which at least can * a placeholder object is put into schema map, which at least can
* re-serialize the data back. * re-serialize the data back.
* *

View File

@@ -331,7 +331,7 @@ schema_ptr global_schema_ptr::get() const {
schema_ptr registered_bs; schema_ptr registered_bs;
// the following code contains registry entry dereference of a foreign shard // the following code contains registry entry dereference of a foreign shard
// however, it is guarantied to succeed since we made sure in the constructor // however, it is guaranteed to succeed since we made sure in the constructor
// that _bs_schema and _ptr will have a registry on the foreign shard where this // that _bs_schema and _ptr will have a registry on the foreign shard where this
// object originated so as long as this object lives the registry entries lives too // object originated so as long as this object lives the registry entries lives too
// and it is safe to reference them on foreign shards. // and it is safe to reference them on foreign shards.

View File

@@ -34,11 +34,11 @@ Sometimes the metadata retrieved from the build lacks the package URL.
In this case, the scylla package can be downloaded manually and extracted In this case, the scylla package can be downloaded manually and extracted
into the artifact directory (see below) using the "scylla.package" name. into the artifact directory (see below) using the "scylla.package" name.
When this directory exists, the script will not attempt to extract the When this directory exists, the script will not attempt to extract the
package URL from the metadata and dowload the package itself, instead it package URL from the metadata and download the package itself, instead it
will use the provided package. will use the provided package.
The script is idempotent: running it after the prepartory steps will The script is idempotent: running it after the prepartory steps will
re-use what is already donwloaded. It is *strongly* recommended to run reuse what is already downloaded. It is *strongly* recommended to run
this from an empty directory, with nothing but the core-file present. this from an empty directory, with nothing but the core-file present.
Options: Options:

View File

@@ -264,7 +264,7 @@ public:
* As during the prepared phase replica send us the last propose they accepted, a first option would be to take * As during the prepared phase replica send us the last propose they accepted, a first option would be to take
* the maximum of those last accepted proposal timestamp plus 1 (and use a default value, say 0, if it's the * the maximum of those last accepted proposal timestamp plus 1 (and use a default value, say 0, if it's the
* first known proposal for the partition). This would mostly work (giving commits the timestamp 0, 1, 2, ... * first known proposal for the partition). This would mostly work (giving commits the timestamp 0, 1, 2, ...
* in the order they are commited) but with 2 important caveats: * in the order they are committed) but with 2 important caveats:
* 1) it would give a very poor experience when Paxos and non-Paxos updates are mixed in the same partition, * 1) it would give a very poor experience when Paxos and non-Paxos updates are mixed in the same partition,
* since paxos operations wouldn't be using microseconds timestamps. And while you shouldn't theoretically * since paxos operations wouldn't be using microseconds timestamps. And while you shouldn't theoretically
* mix the 2 kind of operations, this would still be pretty nonintuitive. And what if you started writing * mix the 2 kind of operations, this would still be pretty nonintuitive. And what if you started writing

View File

@@ -59,7 +59,7 @@ class storage_proxy;
// Query splitting example (3 node cluster with num_tokens set to 3): // Query splitting example (3 node cluster with num_tokens set to 3):
// Original query: forward_request{ // Original query: forward_request{
// reduction_types=[reduction_type{count}], // reduction_types=[reduction_type{count}],
// cmd=read_command{contents ommited}, // cmd=read_command{contents omitted},
// pr={(-inf, +inf)}, // pr={(-inf, +inf)},
// cl=ONE, // cl=ONE,
// timeout(ms)=4864752279 // timeout(ms)=4864752279
@@ -83,7 +83,7 @@ class storage_proxy;
// //
// forward_request{ // forward_request{
// reduction_types=[reduction_type{count}], // reduction_types=[reduction_type{count}],
// cmd=read_command{contents ommited}, // cmd=read_command{contents omitted},
// pr={ // pr={
// (-inf, {-7656156436523256816, end}], // (-inf, {-7656156436523256816, end}],
// ({-885518633547994880, end}, {-881470678946355457, end}], // ({-885518633547994880, end}, {-881470678946355457, end}],
@@ -96,7 +96,7 @@ class storage_proxy;
// //
// forward_request{ // forward_request{
// reduction_types=[reduction_type{count}], // reduction_types=[reduction_type{count}],
// cmd=read_command{contents ommited}, // cmd=read_command{contents omitted},
// pr={ // pr={
// ({-7656156436523256816, end}, {-6273657286650174294, end}], // ({-7656156436523256816, end}, {-6273657286650174294, end}],
// ({-6273657286650174294, end}, {-885518633547994880, end}], // ({-6273657286650174294, end}, {-885518633547994880, end}],
@@ -108,7 +108,7 @@ class storage_proxy;
// //
// forward_request{ // forward_request{
// reduction_types=[reduction_type{count}], // reduction_types=[reduction_type{count}],
// cmd=read_command{contents ommited}, // cmd=read_command{contents omitted},
// pr={ // pr={
// ({-589668175639820781, end}, {1403899953968875783, end}], // ({-589668175639820781, end}, {1403899953968875783, end}],
// ({1403899953968875783, end}, {6175622851574774197, end}], // ({1403899953968875783, end}, {6175622851574774197, end}],

View File

@@ -379,7 +379,7 @@ void query_pager::handle_result(
uint32_t page_size, gc_clock::time_point now) { uint32_t page_size, gc_clock::time_point now) {
auto update_slice = [&] (const partition_key& last_pkey) { auto update_slice = [&] (const partition_key& last_pkey) {
// refs #752, when doing aggregate queries we will re-use same // refs #752, when doing aggregate queries we will reuse same
// slice repeatedly. Since "specific ck ranges" only deal with // slice repeatedly. Since "specific ck ranges" only deal with
// a single extra range, we must clear out the old one // a single extra range, we must clear out the old one
// Even if it was not so of course, leaving junk in the slice // Even if it was not so of course, leaving junk in the slice

View File

@@ -200,7 +200,7 @@ future<> paxos_state::learn(storage_proxy& sp, db::system_keyspace& sys_ks, sche
// Even though there is no guarantee we will see decisions in the right order, // Even though there is no guarantee we will see decisions in the right order,
// because messages can get delayed, so this decision can be older than our current most // because messages can get delayed, so this decision can be older than our current most
// recent accepted proposal/committed decision, saving it is always safe due to column timestamps. // recent accepted proposal/committed decision, saving it is always safe due to column timestamps.
// Since the mutation uses the decision ballot timestamp, if cell timestmap of any current cell // Since the mutation uses the decision ballot timestamp, if cell timestamp of any current cell
// is strictly greater than the decision one, saving the decision will not erase it. // is strictly greater than the decision one, saving the decision will not erase it.
// //
// The table may have been truncated since the proposal was initiated. In that case, we // The table may have been truncated since the proposal was initiated. In that case, we

View File

@@ -60,12 +60,12 @@ private:
static thread_local key_lock_map _paxos_table_lock; static thread_local key_lock_map _paxos_table_lock;
// Taken by the coordinator code to allow only one instance of PAXOS to run for each key. // Taken by the coordinator code to allow only one instance of PAXOS to run for each key.
// This prevents contantion between multiple clients trying to modify the // This prevents contantion between multiple clients trying to modify the
// same key throug the same coordinator and stealing the ballot from // same key through the same coordinator and stealing the ballot from
// eachother. // each other.
static thread_local key_lock_map _coordinator_lock; static thread_local key_lock_map _coordinator_lock;
// protects acess to system.paxos // protects access to system.paxos
template<typename Func> template<typename Func>
static static
futurize_t<std::result_of_t<Func()>> with_locked_key(const dht::token& key, clock_type::time_point timeout, Func func) { futurize_t<std::result_of_t<Func()>> with_locked_key(const dht::token& key, clock_type::time_point timeout, Func func) {

Some files were not shown because too many files have changed in this diff Show More