Skip to content

Commit ada325f

Browse files
committed
fixes
1 parent 3facd07 commit ada325f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/server/hset_family.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,12 @@ struct OpSetParams {
462462
bool skip_if_exists = false;
463463
uint32_t ttl = UINT32_MAX;
464464
bool keepttl = false;
465+
466+
optional<util::fb2::Future<bool>>* backpressure = nullptr;
465467
};
466468

467469
OpResult<CbVariant<uint32_t>> OpSet(const OpArgs& op_args, string_view key, CmdArgList values,
468-
const OpSetParams& op_sp = OpSetParams{},
469-
optional<util::fb2::Future<bool>>* bp_anker = nullptr) {
470+
const OpSetParams& op_sp = OpSetParams{}) {
470471
DCHECK(!values.empty() && 0 == values.size() % 2);
471472
VLOG(2) << "OpSet(" << key << ")";
472473

@@ -486,7 +487,7 @@ OpResult<CbVariant<uint32_t>> OpSet(const OpArgs& op_args, string_view key, CmdA
486487

487488
using D = tiering::SerializedMapDecoder;
488489
util::fb2::Future<OpResult<uint32_t>> fut;
489-
auto read_cb = [fut, values, &op_sp](io::Result<D*> res) mutable {
490+
auto read_cb = [fut, values, op_sp](io::Result<D*> res) mutable {
490491
auto& lw = *res.value()->Write();
491492
uint32_t created = 0;
492493
for (size_t i = 0; i < values.size(); i += 2) {
@@ -556,8 +557,8 @@ OpResult<CbVariant<uint32_t>> OpSet(const OpArgs& op_args, string_view key, CmdA
556557

557558
if (auto* ts = op_args.shard->tiered_storage(); ts) {
558559
auto bp = ts->TryStash(op_args.db_cntx.db_index, key, &pv, true);
559-
if (bp && bp_anker)
560-
*bp_anker = std::move(*bp);
560+
if (bp && op_sp.backpressure)
561+
*op_sp.backpressure = std::move(*bp);
561562
}
562563

563564
return CbVariant<uint32_t>{created};
@@ -923,10 +924,11 @@ void HSetFamily::HSet(CmdArgList args, const CommandContext& cmd_cntx) {
923924
}
924925

925926
optional<util::fb2::Future<bool>> tiered_backpressure;
927+
OpSetParams params{.backpressure = &tiered_backpressure};
926928

927929
args.remove_prefix(1);
928930
auto cb = [&](Transaction* t, EngineShard* shard) {
929-
return OpSet(t->GetOpArgs(shard), key, args, OpSetParams{}, &tiered_backpressure);
931+
return OpSet(t->GetOpArgs(shard), key, args, params);
930932
};
931933

932934
auto delayed_result = cmd_cntx.tx->ScheduleSingleHopT(std::move(cb));

src/server/tiered_storage_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,7 @@ TEST_F(PureDiskTSTest, Dump) {
493493
TEST_P(LatentCoolingTSTest, SimpleHash) {
494494
absl::FlagSaver saver;
495495
absl::SetFlag(&FLAGS_tiered_experimental_hash_support, true);
496-
absl::SetFlag(&FLAGS_tiered_upload_threshold,
497-
0.0); // For now, never upload as its not implemented yet
496+
absl::SetFlag(&FLAGS_tiered_upload_threshold, 0.0); // never upload
498497
UpdateFromFlags();
499498

500499
const size_t kNUM = 100;

0 commit comments

Comments
 (0)