]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: move get_max_object_size() to store level 69256/head
authorRonen Friedman <rfriedma@redhat.com>
Wed, 3 Jun 2026 05:40:25 +0000 (05:40 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 10 Jun 2026 06:42:05 +0000 (06:42 +0000)
is_offset_and_length_valid() called get_sharded_store() locally to
obtain the store-specific max_object_size. On alien cores (where
smp::count > store_shard_nums), the local store is inactive and the
call hits assert(shard_store.get_status() == true).

As the max object size is a store-specific property and not a
store-shard one, there is no reason to acquire the
store shard to obtain it. Instead -
a get_max_object_size() method is added to the Store interface.

Fixes: https://tracker.ceph.com/issues/76946
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/crimson/os/futurized_store.h
src/crimson/os/seastore/seastore.h
src/crimson/osd/pg_backend.cc

index 8ca18388427c6b1493ba15b2136953cdb424d469..5036d9ab458c3439c0f6f54b0f23d0839a66a905 100644 (file)
@@ -207,11 +207,6 @@ public:
       uint32_t op_flags = 0) = 0;
 
     virtual unsigned get_max_attr_name_length() const = 0;
-
-    /// Override to report a tighter per-object cap than osd_max_object_size.
-    virtual uint64_t get_max_object_size() const {
-      return crimson::common::local_conf()->osd_max_object_size;
-    }
   };
 
 public:
@@ -249,6 +244,11 @@ public:
 
   virtual uuid_d get_fsid() const  = 0;
 
+  /// Override to report a tighter per-object cap than osd_max_object_size.
+  virtual uint64_t get_max_object_size() const {
+    return crimson::common::local_conf()->osd_max_object_size;
+  }
+
   virtual seastar::future<> write_meta(const std::string& key,
                                       const std::string& value) = 0;
 
index 4b356f4304a9c3d69543fab8611cdf631c5c76de..5e05b5b70f9712c31d6c243bbabf7f2dc7190339 100644 (file)
@@ -185,12 +185,6 @@ public:
       return 256;
     }
 
-    uint64_t get_max_object_size() const override final {
-      return std::min<uint64_t>(
-        crimson::common::local_conf()->osd_max_object_size,
-        max_object_size);
-    }
-
     omap_root_t select_log_omap_root(Onode& onode) const;
 
   // only exposed to SeaStore
@@ -593,6 +587,12 @@ public:
     return shard_stores.local().mshard_stores[0]->get_fsid();
   }
 
+  uint64_t get_max_object_size() const override final {
+    return std::min<uint64_t>(
+      crimson::common::local_conf()->osd_max_object_size,
+      crimson::common::get_conf<uint64_t>("seastore_default_max_object_size"));
+  }
+
   seastar::future<> write_meta(const std::string& key, const std::string& value) override;
 
   seastar::future<std::tuple<int, std::string>> read_meta(const std::string& key) override;
@@ -624,6 +624,7 @@ public:
     assert(shard_store.get_status() == true);
     return shard_store;
   }
+
   static col_obj_ranges_t
   get_objs_range(CollectionRef ch, unsigned bits);
 
index 9e2557c87c480a4c385e35d637c2205128ec21a7..b8971b2be2bc56e3c59c5b007bdfe62a94f536c0 100644 (file)
@@ -618,15 +618,14 @@ void PGBackend::truncate_update_size_and_usage(object_stat_sum_t& delta_stats,
 }
 
 bool PGBackend::is_offset_and_length_valid(
-  const std::uint64_t offset,
-  const std::uint64_t length) const
+    const std::uint64_t offset,
+    const std::uint64_t length) const
 {
-  if (const std::uint64_t max =
-        store.f_store.get_sharded_store(store.store_index).get_max_object_size();
+  if (const std::uint64_t max = store.f_store.get_max_object_size();
       offset >= max || length > max || offset + length > max) {
     logger().debug("{} max_object_size: {}, offset: {}, len: {}; "
-                   "Hard limit of object size is 4GB",
-                   __func__, max, offset, length);
+        "Hard limit of object size is 4GB",
+        __func__, max, offset, length);
     return false;
   } else {
     return true;