Skip to content

Commit

Permalink
database: database::query*(), database::apply*(): remove default time…
Browse files Browse the repository at this point in the history
…outs
  • Loading branch information
denesb committed Feb 27, 2020
1 parent 2c1ee7b commit 1073094
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions database.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1469,14 +1469,14 @@ public:
unsigned shard_of(const frozen_mutation& m);
future<lw_shared_ptr<query::result>, cache_temperature> query(schema_ptr, const query::read_command& cmd, query::result_options opts,
const dht::partition_range_vector& ranges, tracing::trace_state_ptr trace_state,
uint64_t max_result_size, db::timeout_clock::time_point timeout = db::no_timeout);
uint64_t max_result_size, db::timeout_clock::time_point timeout);
future<reconcilable_result, cache_temperature> query_mutations(schema_ptr, const query::read_command& cmd, const dht::partition_range& range,
query::result_memory_accounter&& accounter, tracing::trace_state_ptr trace_state,
db::timeout_clock::time_point timeout = db::no_timeout);
db::timeout_clock::time_point timeout);
// Apply the mutation atomically.
// Throws timed_out_error when timeout is reached.
future<> apply(schema_ptr, const frozen_mutation&, db::commitlog::force_sync sync, db::timeout_clock::time_point timeout = db::no_timeout);
future<> apply_hint(schema_ptr, const frozen_mutation&, db::timeout_clock::time_point timeout = db::no_timeout);
future<> apply(schema_ptr, const frozen_mutation&, db::commitlog::force_sync sync, db::timeout_clock::time_point timeout);
future<> apply_hint(schema_ptr, const frozen_mutation&, db::timeout_clock::time_point timeout);
future<> apply_streaming_mutation(schema_ptr, utils::UUID plan_id, const frozen_mutation&, bool fragmented);
future<mutation> apply_counter_update(schema_ptr, const frozen_mutation& m, db::timeout_clock::time_point timeout, tracing::trace_state_ptr trace_state);
keyspace::config make_keyspace_config(const keyspace_metadata& ksm);
Expand Down
16 changes: 8 additions & 8 deletions test/boost/database_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ SEASTAR_TEST_CASE(test_safety_after_truncate) {
mutation m(s, pkey);
m.set_clustered_cell(clustering_key_prefix::make_empty(), "v", int32_t(42), {});
pranges.emplace_back(dht::partition_range::make_singular(dht::decorate_key(*s, std::move(pkey))));
db.apply(s, freeze(m), db::commitlog::force_sync::no).get();
db.apply(s, freeze(m), db::commitlog::force_sync::no, db::no_timeout).get();
}

auto assert_query_result = [&] (size_t expected_size) {
auto max_size = std::numeric_limits<size_t>::max();
auto cmd = query::read_command(s->id(), s->version(), partition_slice_builder(*s).build(), 1000);
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size).get0();
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size, db::no_timeout).get0();
assert_that(query::result_set::from_raw_result(s, cmd.slice, *result)).has_size(expected_size);
};
assert_query_result(1000);
Expand Down Expand Up @@ -92,34 +92,34 @@ SEASTAR_TEST_CASE(test_querying_with_limits) {
auto pkey = partition_key::from_single_value(*s, to_bytes(format("key{:d}", i)));
mutation m(s, pkey);
m.partition().apply(tombstone(api::timestamp_type(1), gc_clock::now()));
db.apply(s, freeze(m), db::commitlog::force_sync::no).get();
db.apply(s, freeze(m), db::commitlog::force_sync::no, db::no_timeout).get();
}
for (uint32_t i = 3; i <= 8; ++i) {
auto pkey = partition_key::from_single_value(*s, to_bytes(format("key{:d}", i)));
mutation m(s, pkey);
m.set_clustered_cell(clustering_key_prefix::make_empty(), "v", int32_t(42), 1);
db.apply(s, freeze(m), db::commitlog::force_sync::no).get();
db.apply(s, freeze(m), db::commitlog::force_sync::no, db::no_timeout).get();
pranges.emplace_back(dht::partition_range::make_singular(dht::decorate_key(*s, std::move(pkey))));
}

auto max_size = std::numeric_limits<size_t>::max();
{
auto cmd = query::read_command(s->id(), s->version(), partition_slice_builder(*s).build(), 3);
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size).get0();
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size, db::no_timeout).get0();
assert_that(query::result_set::from_raw_result(s, cmd.slice, *result)).has_size(3);
}

{
auto cmd = query::read_command(s->id(), s->version(), partition_slice_builder(*s).build(),
query::max_rows, gc_clock::now(), std::nullopt, 5);
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size).get0();
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size, db::no_timeout).get0();
assert_that(query::result_set::from_raw_result(s, cmd.slice, *result)).has_size(5);
}

{
auto cmd = query::read_command(s->id(), s->version(), partition_slice_builder(*s).build(),
query::max_rows, gc_clock::now(), std::nullopt, 3);
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size).get0();
auto result = db.query(s, cmd, query::result_options::only_result(), pranges, nullptr, max_size, db::no_timeout).get0();
assert_that(query::result_set::from_raw_result(s, cmd.slice, *result)).has_size(3);
}
});
Expand All @@ -138,7 +138,7 @@ SEASTAR_THREAD_TEST_CASE(test_database_with_data_in_sstables_is_a_mutation_sourc
service::get_local_migration_manager().announce_new_column_family(s, true).get();
column_family& cf = e.local_db().find_column_family(s);
for (auto&& m : partitions) {
e.local_db().apply(cf.schema(), freeze(m), db::commitlog::force_sync::no).get();
e.local_db().apply(cf.schema(), freeze(m), db::commitlog::force_sync::no, db::no_timeout).get();
}
cf.flush().get();
cf.get_row_cache().invalidate([] {}).get();
Expand Down
2 changes: 1 addition & 1 deletion test/boost/multishard_mutation_query_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static std::vector<mutation> read_all_partitions_one_by_one(distributed<database
const auto cmd = query::read_command(s->id(), s->version(), s->full_slice(), query::max_rows);
const auto range = dht::partition_range::make_singular(pkey);
return make_foreign(std::make_unique<reconcilable_result>(
db.query_mutations(std::move(s), cmd, range, std::move(accounter), nullptr).get0()));
db.query_mutations(std::move(s), cmd, range, std::move(accounter), nullptr, db::no_timeout).get0()));
});
}).get0();

Expand Down
2 changes: 1 addition & 1 deletion test/manual/sstable_scan_footprint_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int main(int argc, char** argv) {
uint64_t i = 0;
while (i < sstables) {
auto m = gen();
env.local_db().apply(s, freeze(m), db::commitlog::force_sync::no).get();
env.local_db().apply(s, freeze(m), db::commitlog::force_sync::no, db::no_timeout).get();
if (tab.active_memtable().occupancy().used_space() > sstable_size) {
tab.flush().get();
++i;
Expand Down
2 changes: 1 addition & 1 deletion test/perf/perf_cache_eviction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ int main(int argc, char** argv) {
auto&& col = *s->get_column_definition(to_bytes("v"));
m.set_clustered_cell(ck, col, atomic_cell::make_live(*col.type, api::new_timestamp(), serialized(value)));
auto t0 = clock::now();
db.apply(s, freeze(m), db::commitlog::force_sync::no).get();
db.apply(s, freeze(m), db::commitlog::force_sync::no, db::no_timeout).get();
writes_hist.add(std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - t0).count());
++mutations;
}
Expand Down

0 comments on commit 1073094

Please sign in to comment.