assert(this == cursor.get_leaf_node().get());
assert(cursor.is_tracked());
assert(!impl->is_extent_retired());
+
+ // We need to make sure user has freed all the cursors before submitting the
+ // according transaction. Otherwise the below checks will have undefined
+ // behaviors.
auto [key, p_value_header] = get_kv(cursor.get_position());
auto magic = p_value_header->magic;
assert(key.compare_to(cursor.get_key_view(magic)) == MatchKindCMP::EQ);
* - Runs above seastore block and transaction layer;
* - Specially optimized for onode key structures and seastore
* delta/transaction semantics;
+ *
+ * Note: User should not hold any Cursor/Value when call
+ * submit_transaction() because of validations implemented in ~tree_cursor_t().
*/
namespace crimson::os::seastore::onode {
}
}
+ /// Invalidate the Cursor before submitting transaction.
+ void invalidate() {
+ p_cursor.reset();
+ }
+
// XXX: return key_view_t to avoid unecessary ghobject_t constructions
ghobject_t get_ghobj() const {
assert(!is_end());
return p_cursor->is_tracked();
}
+void Value::invalidate()
+{
+ p_cursor.reset();
+}
+
eagain_future<> Value::extend(Transaction& t, value_size_t extend_size)
{
assert(is_tracked());
/// Returns whether the Value is still tracked in tree.
bool is_tracked() const;
+ /// Invalidate the Value before submitting transaction.
+ void invalidate();
+
/// Returns the value payload size.
value_size_t get_payload_size() const {
assert(is_tracked());
}).safe_then([this, &ctx] {
return onode_manager->write_dirty(*ctx.transaction, ctx.onodes);
}).safe_then([this, &ctx] {
+ // There are some validations in onode tree during onode value
+ // destruction in debug mode, which need to be done before calling
+ // submit_transaction().
+ ctx.onodes.clear();
return transaction_manager->submit_transaction(std::move(ctx.transaction));
}).safe_then([&ctx]() {
for (auto i : {