Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 2 additions & 43 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5373,8 +5373,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
rocksdb::WriteOptions write_opts;
// Called after commit/rollback.
void reset() {
assert(!is_ac_nl_ro_rc_transaction());

m_batch->Clear();
m_read_opts[USER_TABLE] = rocksdb::ReadOptions();
m_read_opts[USER_TABLE].ignore_range_deletions =
Expand All @@ -5384,8 +5382,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {

private:
bool prepare() override {
assert(!is_ac_nl_ro_rc_transaction());

return true;
}

Expand Down Expand Up @@ -5430,27 +5426,19 @@ class Rdb_writebatch_impl : public Rdb_transaction {

/* Implementations of do_*savepoint based on rocksdB::WriteBatch savepoints */
void do_set_savepoint() override {
assert(!is_ac_nl_ro_rc_transaction());

m_batch->SetSavePoint();
}

rocksdb::Status do_pop_savepoint() override {
assert(!is_ac_nl_ro_rc_transaction());

return m_batch->PopSavePoint();
}

void do_rollback_to_savepoint() override {
assert(!is_ac_nl_ro_rc_transaction());

m_batch->RollbackToSavePoint();
}

public:
bool is_writebatch_trx() const override {
assert(!is_ac_nl_ro_rc_transaction());

return true;
}

Expand All @@ -5462,8 +5450,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}

void set_sync(bool sync) override {
assert(!is_ac_nl_ro_rc_transaction());

write_opts.sync = sync;
}

Expand All @@ -5476,8 +5462,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}

void rollback() override {
assert(!is_ac_nl_ro_rc_transaction());

on_rollback();
m_write_count[TABLE_TYPE::USER_TABLE] = 0;
m_insert_count = 0;
Expand All @@ -5493,8 +5477,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {

void acquire_snapshot(bool acquire_now MY_ATTRIBUTE((unused)),
TABLE_TYPE table_type) override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return;
Expand All @@ -5504,8 +5486,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}

void release_snapshot(TABLE_TYPE table_type) override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return;
Expand Down Expand Up @@ -5564,33 +5544,26 @@ class Rdb_writebatch_impl : public Rdb_transaction {
return rocksdb::Status::NotSupported(
"Not supported for intrinsic tmp tables");
}
assert(!is_ac_nl_ro_rc_transaction());

++m_write_count[table_type];
return m_batch->SingleDelete(column_family, key);
}

bool has_modifications() const override {
assert(!is_ac_nl_ro_rc_transaction());

return m_batch->GetWriteBatch()->Count() > 0;
}

rocksdb::WriteBatchBase *get_write_batch() override {
assert(!is_ac_nl_ro_rc_transaction());

return m_batch;
}

rocksdb::WriteBatchBase *get_indexed_write_batch(
TABLE_TYPE table_type) override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == TABLE_TYPE::INTRINSIC_TMP) {
assert(false);
return nullptr;
}
assert(!is_ac_nl_ro_rc_transaction());

++m_write_count[table_type];
return m_batch;
Expand All @@ -5600,8 +5573,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
const rocksdb::Slice &key,
rocksdb::PinnableSlice *const value,
TABLE_TYPE table_type) const override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return rocksdb::Status::NotSupported(
Expand All @@ -5617,8 +5588,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
rocksdb::PinnableSlice *values, TABLE_TYPE table_type,
rocksdb::Status *statuses,
const bool sorted_input) const override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return;
Expand Down Expand Up @@ -5656,8 +5625,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
const rocksdb::ReadOptions &options,
rocksdb::ColumnFamilyHandle *const /* column_family */,
const TABLE_TYPE table_type) override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return nullptr;
Expand All @@ -5667,8 +5634,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}

bool is_tx_started(TABLE_TYPE table_type) const override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return false;
Expand All @@ -5677,8 +5642,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}

void start_tx(TABLE_TYPE table_type) override {
assert(!is_ac_nl_ro_rc_transaction());

if (table_type == INTRINSIC_TMP) {
assert(false);
return;
Expand All @@ -5695,13 +5658,11 @@ class Rdb_writebatch_impl : public Rdb_transaction {
set_initial_savepoint();
}

void set_name() override { assert(!is_ac_nl_ro_rc_transaction()); }
void set_name() override {}

void start_stmt() override { assert(!is_ac_nl_ro_rc_transaction()); }
void start_stmt() override {}

void rollback_stmt() override {
assert(!is_ac_nl_ro_rc_transaction());

if (m_batch) rollback_to_stmt_savepoint();
}

Expand All @@ -5712,8 +5673,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}

virtual ~Rdb_writebatch_impl() override {
assert(!is_ac_nl_ro_rc_transaction());

// Remove from the global list before all other processing is started.
// Otherwise, information_schema.rocksdb_trx can crash on this object.
Rdb_transaction::remove_from_global_trx_list();
Expand Down