Merge 'treewide: fix warnings from GCC-13' from Kefu Chai

this series silences the warnings from GCC 13. some of these changes are considered as critical fixes, and posted separately.

see also #13243

Closes #13723

* github.com:scylladb/scylladb:
  cdc: initialize an optional using its value type
  compaction: disambiguate type name
  db: schema_tables: drop unused variable
  reader_concurrency_semaphore: fix signed/unsigned comparision
  locator: topology: disambiguate type names
  raft: disambiguate promise name in raft::awaited_conf_changes
This commit is contained in:
Avi Kivity
2023-05-01 22:48:00 +03:00
6 changed files with 12 additions and 12 deletions

View File

@@ -389,7 +389,7 @@ struct extract_changes_visitor {
}
void partition_delete(const tombstone& t) {
_result[t.timestamp].partition_deletions = {t};
_result[t.timestamp].partition_deletions = partition_deletion{t};
}
constexpr bool finished() const { return false; }

View File

@@ -35,7 +35,7 @@ struct compaction_state {
compaction_backlog_tracker backlog_tracker;
std::unordered_set<sstables::shared_sstable> sstables_requiring_cleanup;
owned_ranges_ptr owned_ranges_ptr;
compaction::owned_ranges_ptr owned_ranges_ptr;
explicit compaction_state(table_state& t);
compaction_state(compaction_state&&) = delete;

View File

@@ -1486,7 +1486,6 @@ static future<> merge_tables_and_views(distributed<service::storage_proxy>& prox
// to a mv not finding its schema when snapshoting since the main table
// was already dropped (see https://github.com/scylladb/scylla/issues/5614)
auto& db = proxy.local().get_db();
auto ts = db_clock::now();
co_await max_concurrent_for_each(views_diff.dropped, max_concurrent, [&db] (schema_diff::dropped_schema& dt) {
auto& s = *dt.schema.get();
return replica::database::drop_table_on_all_shards(db, s.ks_name(), s.cf_name());

View File

@@ -51,8 +51,8 @@ public:
};
private:
const topology* _topology;
host_id _host_id;
const locator::topology* _topology;
locator::host_id _host_id;
inet_address _endpoint;
endpoint_dc_rack _dc_rack;
state _state;
@@ -67,11 +67,11 @@ public:
node(const node&) = delete;
node(node&&) = delete;
const topology* topology() const noexcept {
const locator::topology* topology() const noexcept {
return _topology;
}
const host_id& host_id() const noexcept {
const locator::host_id& host_id() const noexcept {
return _host_id;
}

View File

@@ -39,12 +39,12 @@ struct active_read {
};
struct awaited_index {
promise<> promise;
seastar::promise<> promise;
optimized_optional<abort_source::subscription> abort;
};
struct awaited_conf_change {
promise<> promise;
seastar::promise<> promise;
optimized_optional<abort_source::subscription> abort;
};

View File

@@ -13,6 +13,7 @@
#include <seastar/util/log.hh>
#include <seastar/core/coroutine.hh>
#include <seastar/coroutine/maybe_yield.hh>
#include <utility>
#include "reader_concurrency_semaphore.hh"
#include "readers/flat_mutation_reader_v2.hh"
@@ -928,7 +929,7 @@ void reader_concurrency_semaphore::consume(reader_permit::impl& permit, resource
// We check whether we even reached the memory limit first.
// This is a cheap check and should be false most of the time, providing a
// cheap short-circuit.
if (_resources.memory <= 0 && (consumed_resources().memory + r.memory) >= get_kill_limit()) [[unlikely]] {
if (_resources.memory <= 0 && std::cmp_greater_equal(consumed_resources().memory + r.memory, get_kill_limit())) [[unlikely]] {
if (permit.on_oom_kill()) {
++_stats.total_reads_killed_due_to_kill_limit;
}
@@ -1220,10 +1221,10 @@ reader_concurrency_semaphore::admit_result
reader_concurrency_semaphore::can_admit_read(const reader_permit::impl& permit) const noexcept {
if (_resources.memory < 0) [[unlikely]] {
const auto consumed_memory = consumed_resources().memory;
if (consumed_memory >= get_kill_limit()) {
if (std::cmp_greater_equal(consumed_memory, get_kill_limit())) {
return {can_admit::no, reason::memory_resources};
}
if (consumed_memory >= get_serialize_limit()) {
if (std::cmp_greater_equal(consumed_memory, get_serialize_limit())) {
if (_blessed_permit) {
// blessed permit is never in the wait list
return {can_admit::no, reason::memory_resources};