diff --git a/src/box/memtx_tx.c b/src/box/memtx_tx.c index 2f8fd4f8fb81..5444e346238f 100644 --- a/src/box/memtx_tx.c +++ b/src/box/memtx_tx.c @@ -2018,7 +2018,7 @@ memtx_tx_history_add_stmt(struct txn_stmt *stmt, struct tuple *old_tuple, struct tuple **result) { assert(stmt != NULL); - assert(stmt->space != NULL); + assert(stmt->space != NULL && !stmt->space->def->opts.is_ephemeral); assert(new_tuple != NULL || old_tuple != NULL); assert(new_tuple == NULL || !tuple_has_flag(new_tuple, TUPLE_IS_DIRTY)); @@ -2659,11 +2659,7 @@ static void memtx_tx_track_read_story(struct txn *txn, struct space *space, struct memtx_story *story, uint64_t index_mask) { - if (txn == NULL) - return; - if (space == NULL) - return; - if (space->def->opts.is_ephemeral) + if (txn == NULL || space == NULL || space->def->opts.is_ephemeral) return; (void)space; assert(story != NULL); @@ -2708,11 +2704,7 @@ memtx_tx_track_read(struct txn *txn, struct space *space, struct tuple *tuple) { if (tuple == NULL) return; - if (txn == NULL) - return; - if (space == NULL) - return; - if (space->def->opts.is_ephemeral) + if (txn == NULL || space == NULL || space->def->opts.is_ephemeral) return; if (tuple_has_flag(tuple, TUPLE_IS_DIRTY)) { diff --git a/src/box/memtx_tx.h b/src/box/memtx_tx.h index 9f2dfeb01bb6..2c03c98cf6f9 100644 --- a/src/box/memtx_tx.h +++ b/src/box/memtx_tx.h @@ -282,10 +282,7 @@ memtx_tx_track_point(struct txn *txn, struct space *space, { if (!memtx_tx_manager_use_mvcc_engine) return; - if (txn == NULL) - return; - /* Skip ephemeral spaces. */ - if (space == NULL || space->def->id == 0) + if (txn == NULL || space == NULL || space->def->opts.is_ephemeral) return; memtx_tx_track_point_slow(txn, index, key); } @@ -315,10 +312,7 @@ memtx_tx_track_gap(struct txn *txn, struct space *space, struct index *index, { if (!memtx_tx_manager_use_mvcc_engine) return; - if (txn == NULL) - return; - /* Skip ephemeral spaces. */ - if (space == NULL || space->def->id == 0) + if (txn == NULL || space == NULL || space->def->opts.is_ephemeral) return; memtx_tx_track_gap_slow(txn, space, index, successor, type, key, part_count); @@ -346,10 +340,7 @@ memtx_tx_track_full_scan(struct txn *txn, struct space *space, { if (!memtx_tx_manager_use_mvcc_engine) return; - if (txn == NULL) - return; - /* Skip ephemeral spaces. */ - if (space == NULL || space->def->id == 0) + if (txn == NULL || space == NULL || space->def->opts.is_ephemeral) return; memtx_tx_track_full_scan_slow(txn, index); }