Skip to content

Commit fd1b9ec

Browse files
committed
fixes
1 parent 80e6f67 commit fd1b9ec

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
@@ -463,11 +463,12 @@ struct OpSetParams {
463463
bool skip_if_exists = false;
464464
uint32_t ttl = UINT32_MAX;
465465
bool keepttl = false;
466+
467+
optional<util::fb2::Future<bool>>* backpressure = nullptr;
466468
};
467469

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

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

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

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

564565
return CbVariant<uint32_t>{created};
@@ -921,10 +922,11 @@ void CmdHSet(CmdArgList args, CommandContext* cmd_cntx) {
921922
}
922923

923924
optional<util::fb2::Future<bool>> tiered_backpressure;
925+
OpSetParams params{.backpressure = &tiered_backpressure};
924926

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

930932
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
@@ -499,8 +499,7 @@ TEST_F(PureDiskTSTest, Dump) {
499499
TEST_P(LatentCoolingTSTest, SimpleHash) {
500500
absl::FlagSaver saver;
501501
absl::SetFlag(&FLAGS_tiered_experimental_hash_support, true);
502-
absl::SetFlag(&FLAGS_tiered_upload_threshold,
503-
0.0); // For now, never upload as its not implemented yet
502+
absl::SetFlag(&FLAGS_tiered_upload_threshold, 0.0); // never upload
504503
UpdateFromFlags();
505504

506505
const size_t kNUM = 100;

0 commit comments

Comments
 (0)