Skip to content

Commit 10c9a4d

Browse files
authored
Merge pull request ceph#60891 from xxhdx1985126/wip-seastore-fadvise-backfill
crimson/os/seastore: add fadvise support to SeaStore and prevent recovery/backfill from polluting the cache of SeaStore Reviewed-by: Yingxin Cheng <[email protected]> Reviewed-by: Matan Breizman <[email protected]>
2 parents 093e0de + 44233b9 commit 10c9a4d

21 files changed

+297
-118
lines changed

src/crimson/os/alienstore/alien_store.cc

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ seastar::future<> AlienStore::stop()
141141
AlienStore::base_errorator::future<bool>
142142
AlienStore::exists(
143143
CollectionRef ch,
144-
const ghobject_t& oid)
144+
const ghobject_t& oid,
145+
uint32_t op_flags)
145146
{
146147
return op_gates.simple_dispatch("exists", [=, this] {
147148
return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, this] {
@@ -212,7 +213,8 @@ seastar::future<std::tuple<std::vector<ghobject_t>, ghobject_t>>
212213
AlienStore::list_objects(CollectionRef ch,
213214
const ghobject_t& start,
214215
const ghobject_t& end,
215-
uint64_t limit) const
216+
uint64_t limit,
217+
uint32_t op_flags) const
216218
{
217219
logger().debug("{}", __func__);
218220
assert(tp);
@@ -348,7 +350,8 @@ AlienStore::readv(CollectionRef ch,
348350
AlienStore::get_attr_errorator::future<ceph::bufferlist>
349351
AlienStore::get_attr(CollectionRef ch,
350352
const ghobject_t& oid,
351-
std::string_view name) const
353+
std::string_view name,
354+
uint32_t op_flags) const
352355
{
353356
logger().debug("{}", __func__);
354357
assert(tp);
@@ -376,7 +379,8 @@ AlienStore::get_attr(CollectionRef ch,
376379

377380
AlienStore::get_attrs_ertr::future<AlienStore::attrs_t>
378381
AlienStore::get_attrs(CollectionRef ch,
379-
const ghobject_t& oid)
382+
const ghobject_t& oid,
383+
uint32_t op_flags)
380384
{
381385
logger().debug("{}", __func__);
382386
assert(tp);
@@ -397,7 +401,8 @@ AlienStore::get_attrs(CollectionRef ch,
397401

398402
auto AlienStore::omap_get_values(CollectionRef ch,
399403
const ghobject_t& oid,
400-
const set<string>& keys)
404+
const set<string>& keys,
405+
uint32_t op_flags)
401406
-> read_errorator::future<omap_values_t>
402407
{
403408
logger().debug("{}", __func__);
@@ -421,7 +426,8 @@ auto AlienStore::omap_get_values(CollectionRef ch,
421426

422427
auto AlienStore::omap_get_values(CollectionRef ch,
423428
const ghobject_t &oid,
424-
const std::optional<string> &start)
429+
const std::optional<string> &start,
430+
uint32_t op_flags)
425431
-> read_errorator::future<std::tuple<bool, omap_values_t>>
426432
{
427433
logger().debug("{} with_start", __func__);
@@ -578,7 +584,8 @@ unsigned AlienStore::get_max_attr_name_length() const
578584

579585
seastar::future<struct stat> AlienStore::stat(
580586
CollectionRef ch,
581-
const ghobject_t& oid)
587+
const ghobject_t& oid,
588+
uint32_t op_flags)
582589
{
583590
assert(tp);
584591
return do_with_op_gate((struct stat){}, [this, ch, oid](auto& st) {
@@ -604,7 +611,8 @@ seastar::future<std::string> AlienStore::get_default_device_class()
604611
}
605612

606613
auto AlienStore::omap_get_header(CollectionRef ch,
607-
const ghobject_t& oid)
614+
const ghobject_t& oid,
615+
uint32_t op_flags)
608616
-> get_attr_errorator::future<ceph::bufferlist>
609617
{
610618
assert(tp);
@@ -630,7 +638,8 @@ AlienStore::read_errorator::future<std::map<uint64_t, uint64_t>> AlienStore::fie
630638
CollectionRef ch,
631639
const ghobject_t& oid,
632640
uint64_t off,
633-
uint64_t len)
641+
uint64_t len,
642+
uint32_t op_flags)
634643
{
635644
assert(tp);
636645
return do_with_op_gate(std::map<uint64_t, uint64_t>(), [=, this](auto& destmap) {

src/crimson/os/alienstore/alien_store.h

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class AlienStore final : public FuturizedStore,
3636

3737
base_errorator::future<bool> exists(
3838
CollectionRef c,
39-
const ghobject_t& oid) final;
39+
const ghobject_t& oid,
40+
uint32_t op_flags = 0) final;
4041
mkfs_ertr::future<> mkfs(uuid_d new_osd_fsid) final;
4142
read_errorator::future<ceph::bufferlist> read(CollectionRef c,
4243
const ghobject_t& oid,
@@ -49,29 +50,36 @@ class AlienStore final : public FuturizedStore,
4950
uint32_t op_flags = 0) final;
5051

5152

52-
get_attr_errorator::future<ceph::bufferlist> get_attr(CollectionRef c,
53-
const ghobject_t& oid,
54-
std::string_view name) const final;
55-
get_attrs_ertr::future<attrs_t> get_attrs(CollectionRef c,
56-
const ghobject_t& oid) final;
53+
get_attr_errorator::future<ceph::bufferlist> get_attr(
54+
CollectionRef c,
55+
const ghobject_t& oid,
56+
std::string_view name,
57+
uint32_t op_flags = 0) const final;
58+
get_attrs_ertr::future<attrs_t> get_attrs(
59+
CollectionRef c,
60+
const ghobject_t& oid,
61+
uint32_t op_flags = 0) final;
5762

5863
read_errorator::future<omap_values_t> omap_get_values(
5964
CollectionRef c,
6065
const ghobject_t& oid,
61-
const omap_keys_t& keys) final;
66+
const omap_keys_t& keys,
67+
uint32_t op_flags = 0) final;
6268

6369
/// Retrieves paged set of values > start (if present)
6470
read_errorator::future<std::tuple<bool, omap_values_t>> omap_get_values(
6571
CollectionRef c, ///< [in] collection
6672
const ghobject_t &oid, ///< [in] oid
67-
const std::optional<std::string> &start ///< [in] start, empty for begin
73+
const std::optional<std::string> &start, ///< [in] start, empty for begin
74+
uint32_t op_flags = 0
6875
) final; ///< @return <done, values> values.empty() iff done
6976

7077
seastar::future<std::tuple<std::vector<ghobject_t>, ghobject_t>> list_objects(
7178
CollectionRef c,
7279
const ghobject_t& start,
7380
const ghobject_t& end,
74-
uint64_t limit) const final;
81+
uint64_t limit,
82+
uint32_t op_flags = 0) const final;
7583

7684
seastar::future<CollectionRef> create_new_collection(const coll_t& cid) final;
7785
seastar::future<CollectionRef> open_collection(const coll_t& cid) final;
@@ -97,16 +105,19 @@ class AlienStore final : public FuturizedStore,
97105
unsigned get_max_attr_name_length() const final;
98106
seastar::future<struct stat> stat(
99107
CollectionRef,
100-
const ghobject_t&) final;
108+
const ghobject_t&,
109+
uint32_t op_flags = 0) final;
101110
seastar::future<std::string> get_default_device_class() final;
102111
get_attr_errorator::future<ceph::bufferlist> omap_get_header(
103112
CollectionRef,
104-
const ghobject_t&) final;
113+
const ghobject_t&,
114+
uint32_t) final;
105115
read_errorator::future<std::map<uint64_t, uint64_t>> fiemap(
106116
CollectionRef,
107117
const ghobject_t&,
108118
uint64_t off,
109-
uint64_t len) final;
119+
uint64_t len,
120+
uint32_t op_flags) final;
110121

111122
FuturizedStore::Shard& get_sharded_store() final {
112123
return *this;

src/crimson/os/cyanstore/cyan_store.cc

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ CyanStore::Shard::list_objects(
208208
CollectionRef ch,
209209
const ghobject_t& start,
210210
const ghobject_t& end,
211-
uint64_t limit) const
211+
uint64_t limit,
212+
uint32_t op_flags) const
212213
{
213214
auto c = static_cast<Collection*>(ch.get());
214215
logger().debug("{} {} {} {} {}",
@@ -257,7 +258,8 @@ CyanStore::Shard::list_collections()
257258
CyanStore::Shard::base_errorator::future<bool>
258259
CyanStore::Shard::exists(
259260
CollectionRef ch,
260-
const ghobject_t &oid)
261+
const ghobject_t &oid,
262+
uint32_t op_flags)
261263
{
262264
auto c = static_cast<Collection*>(ch.get());
263265
if (!c->exists) {
@@ -333,7 +335,8 @@ CyanStore::Shard::get_attr_errorator::future<ceph::bufferlist>
333335
CyanStore::Shard::get_attr(
334336
CollectionRef ch,
335337
const ghobject_t& oid,
336-
std::string_view name) const
338+
std::string_view name,
339+
uint32_t op_flags) const
337340
{
338341
auto c = static_cast<Collection*>(ch.get());
339342
logger().debug("{} {} {}",
@@ -352,7 +355,8 @@ CyanStore::Shard::get_attr(
352355
CyanStore::Shard::get_attrs_ertr::future<CyanStore::Shard::attrs_t>
353356
CyanStore::Shard::get_attrs(
354357
CollectionRef ch,
355-
const ghobject_t& oid)
358+
const ghobject_t& oid,
359+
uint32_t op_flags)
356360
{
357361
auto c = static_cast<Collection*>(ch.get());
358362
logger().debug("{} {} {}",
@@ -367,7 +371,8 @@ CyanStore::Shard::get_attrs(
367371
auto CyanStore::Shard::omap_get_values(
368372
CollectionRef ch,
369373
const ghobject_t& oid,
370-
const omap_keys_t& keys)
374+
const omap_keys_t& keys,
375+
uint32_t op_flags)
371376
-> read_errorator::future<omap_values_t>
372377
{
373378
auto c = static_cast<Collection*>(ch.get());
@@ -388,7 +393,8 @@ auto CyanStore::Shard::omap_get_values(
388393
auto CyanStore::Shard::omap_get_values(
389394
CollectionRef ch,
390395
const ghobject_t &oid,
391-
const std::optional<string> &start)
396+
const std::optional<string> &start,
397+
uint32_t op_flags)
392398
-> CyanStore::Shard::read_errorator::future<std::tuple<bool, omap_values_t>>
393399
{
394400
auto c = static_cast<Collection*>(ch.get());
@@ -409,7 +415,8 @@ auto CyanStore::Shard::omap_get_values(
409415

410416
auto CyanStore::Shard::omap_get_header(
411417
CollectionRef ch,
412-
const ghobject_t& oid)
418+
const ghobject_t& oid,
419+
uint32_t op_flags)
413420
-> CyanStore::Shard::get_attr_errorator::future<ceph::bufferlist>
414421
{
415422
auto c = static_cast<Collection*>(ch.get());
@@ -977,7 +984,8 @@ CyanStore::Shard::fiemap(
977984
CollectionRef ch,
978985
const ghobject_t& oid,
979986
uint64_t off,
980-
uint64_t len)
987+
uint64_t len,
988+
uint32_t op_flags)
981989
{
982990
auto c = static_cast<Collection*>(ch.get());
983991

@@ -992,7 +1000,8 @@ CyanStore::Shard::fiemap(
9921000
seastar::future<struct stat>
9931001
CyanStore::Shard::stat(
9941002
CollectionRef ch,
995-
const ghobject_t& oid)
1003+
const ghobject_t& oid,
1004+
uint32_t op_flags)
9961005
{
9971006
auto c = static_cast<Collection*>(ch.get());
9981007
auto o = c->get_object(oid);

src/crimson/os/cyanstore/cyan_store.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ class CyanStore final : public FuturizedStore {
3434

3535
seastar::future<struct stat> stat(
3636
CollectionRef c,
37-
const ghobject_t& oid) final;
37+
const ghobject_t& oid,
38+
uint32_t op_flags = 0) final;
3839

3940
base_errorator::future<bool> exists(
4041
CollectionRef ch,
41-
const ghobject_t& oid) final;
42+
const ghobject_t& oid,
43+
uint32_t op_flags = 0) final;
4244

4345
read_errorator::future<ceph::bufferlist> read(
4446
CollectionRef c,
@@ -56,33 +58,39 @@ class CyanStore final : public FuturizedStore {
5658
get_attr_errorator::future<ceph::bufferlist> get_attr(
5759
CollectionRef c,
5860
const ghobject_t& oid,
59-
std::string_view name) const final;
61+
std::string_view name,
62+
uint32_t op_flags = 0) const final;
6063

6164
get_attrs_ertr::future<attrs_t> get_attrs(
6265
CollectionRef c,
63-
const ghobject_t& oid) final;
66+
const ghobject_t& oid,
67+
uint32_t op_flags = 0) final;
6468

6569
read_errorator::future<omap_values_t> omap_get_values(
6670
CollectionRef c,
6771
const ghobject_t& oid,
68-
const omap_keys_t& keys) final;
72+
const omap_keys_t& keys,
73+
uint32_t op_flags = 0) final;
6974

7075
read_errorator::future<std::tuple<bool, omap_values_t>> omap_get_values(
7176
CollectionRef c, ///< [in] collection
7277
const ghobject_t &oid, ///< [in] oid
73-
const std::optional<std::string> &start ///< [in] start, empty for begin
78+
const std::optional<std::string> &start, ///< [in] start, empty for begin
79+
uint32_t op_flags = 0
7480
) final;
7581

7682
get_attr_errorator::future<ceph::bufferlist> omap_get_header(
7783
CollectionRef c,
78-
const ghobject_t& oid) final;
84+
const ghobject_t& oid,
85+
uint32_t op_flags = 0) final;
7986

8087
seastar::future<std::tuple<std::vector<ghobject_t>, ghobject_t>>
8188
list_objects(
8289
CollectionRef c,
8390
const ghobject_t& start,
8491
const ghobject_t& end,
85-
uint64_t limit) const final;
92+
uint64_t limit,
93+
uint32_t op_flags = 0) const final;
8694

8795
seastar::future<CollectionRef> create_new_collection(const coll_t& cid) final;
8896

@@ -101,7 +109,8 @@ class CyanStore final : public FuturizedStore {
101109
CollectionRef c,
102110
const ghobject_t& oid,
103111
uint64_t off,
104-
uint64_t len) final;
112+
uint64_t len,
113+
uint32_t op_flags) final;
105114

106115
unsigned get_max_attr_name_length() const final;
107116

0 commit comments

Comments
 (0)