diff --git a/src/box/memtx_tx.c b/src/box/memtx_tx.c index 8382b9eb0ddd..f3b043b81396 100644 --- a/src/box/memtx_tx.c +++ b/src/box/memtx_tx.c @@ -2023,7 +2023,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 || !new_tuple->is_dirty); @@ -2666,11 +2666,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); @@ -2715,11 +2711,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->is_dirty) { diff --git a/src/box/memtx_tx.h b/src/box/memtx_tx.h index cfbad3240980..5ab55817d5f3 100644 --- a/src/box/memtx_tx.h +++ b/src/box/memtx_tx.h @@ -283,10 +283,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); } @@ -316,10 +313,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); @@ -347,10 +341,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); }