diff --git a/src/yb/client/ql-stress-test.cc b/src/yb/client/ql-stress-test.cc index 433c37439a670..aa85311cef3b3 100644 --- a/src/yb/client/ql-stress-test.cc +++ b/src/yb/client/ql-stress-test.cc @@ -39,7 +39,6 @@ DECLARE_double(respond_write_failed_probability); DECLARE_bool(detect_duplicates_for_retryable_requests); DECLARE_int32(raft_heartbeat_interval_ms); -DECLARE_bool(flush_rocksdb_on_shutdown); using namespace std::literals; @@ -482,45 +481,5 @@ TEST_F_EX(QLStressTest, FlushCompact, QLStressTestSingleTablet) { ASSERT_GE(num_iter, 5); } -TEST_F_EX(QLStressTest, LogReplayAfterCompaction, QLStressTestSingleTablet) { - SetAtomicFlag(false, &FLAGS_flush_rocksdb_on_shutdown); - auto session = NewSession(); - int num_writes = 1000; - for (int j = 0; j < num_writes; ++j) { - ASSERT_OK(WriteRow(session, j, "value" + std::to_string(j))); - } - vector op_ids; - ASSERT_OK(cluster_->FlushTablets(tablet::FlushMode::kSync)); - ASSERT_NO_FATALS(VerifyFlushedFrontiers()); - for (const auto& mini_tserver : cluster_->mini_tablet_servers()) { - auto peers = mini_tserver->server()->tablet_manager()->GetTabletPeers(); - for (const auto &peer : peers) { - rocksdb::DB *db = peer->tablet()->TEST_db(); - OpId op_id; - ASSERT_NO_FATALS(VerifyFlushedFrontier(db->GetFlushedFrontier(), &op_id)); - op_ids.push_back(op_id); - } - } - ASSERT_OK(cluster_->CompactTablets()); - int num_unflushed_writes = 2000; - for (int j = 100; j < 100+num_unflushed_writes; ++j) { - ASSERT_OK(WriteRow(session, j, "value" + std::to_string(j))); - } - ASSERT_OK(cluster_->RestartSync()); - int i = 0; - for (const auto& mini_tserver : cluster_->mini_tablet_servers()) { - auto peers = mini_tserver->server()->tablet_manager()->GetTabletPeers(); - for (const auto &peer : peers) { - rocksdb::DB *db = peer->tablet()->TEST_db(); - OpId op_id; - ASSERT_NO_FATALS(VerifyFlushedFrontier(db->GetFlushedFrontier(), &op_id)); - ASSERT_EQ(op_id, op_ids[i]); - i++; - } - ASSERT_WITHIN_INCLUSIVE(num_unflushed_writes - 5, num_unflushed_writes + 5, - mini_tserver->server()->tablet_manager()->num_replayed()); - } -} - } // namespace client } // namespace yb diff --git a/src/yb/consensus/consensus.h b/src/yb/consensus/consensus.h index c76a3a274cd95..cafae00085452 100644 --- a/src/yb/consensus/consensus.h +++ b/src/yb/consensus/consensus.h @@ -109,9 +109,6 @@ struct ConsensusBootstrapInfo { // These are owned by the ConsensusBootstrapInfo instance. ReplicateMsgs orphaned_replicates; - // The number of of WAL log records that tablet bootstrap replayed. - int64_t num_log_records_replayed; - private: DISALLOW_COPY_AND_ASSIGN(ConsensusBootstrapInfo); }; diff --git a/src/yb/tablet/tablet.h b/src/yb/tablet/tablet.h index 6372b5396ca08..1e4f0d7065f1f 100644 --- a/src/yb/tablet/tablet.h +++ b/src/yb/tablet/tablet.h @@ -463,10 +463,6 @@ class Tablet : public AbstractTablet, public TransactionIntentApplier { return *ql_storage_; } - bool HasIntentsDB() { - return intents_db_ != nullptr; - } - // Used from tests const std::shared_ptr& rocksdb_statistics() const { return rocksdb_statistics_; diff --git a/src/yb/tablet/tablet_bootstrap.cc b/src/yb/tablet/tablet_bootstrap.cc index 3477a410499b0..8099a280f0f62 100644 --- a/src/yb/tablet/tablet_bootstrap.cc +++ b/src/yb/tablet/tablet_bootstrap.cc @@ -603,13 +603,8 @@ Status TabletBootstrap::HandleReplicateMessage( // Append the replicate message to the log as is RETURN_NOT_OK(log_->Append(replicate_entry_ptr->get(), entry_time)); - int64_t min_index; - if (tablet_->HasIntentsDB()) { - min_index = std::min( - state->regular_stored_op_id.index(), state->intents_stored_op_id.index()); - } else { - min_index = state->regular_stored_op_id.index(); - } + auto min_index = std::min( + state->regular_stored_op_id.index(), state->intents_stored_op_id.index()); if (op_id.index() <= min_index) { // Do not update the bootstrap in-memory state for log records that have already been applied to // RocksDB, or were overwritten by a later entry with a higher term that has already been @@ -884,7 +879,6 @@ Status TabletBootstrap::PlaySegments(ConsensusBootstrapInfo* consensus_info) { tablet_->mvcc_manager()->SetLastReplicated(state.max_committed_hybrid_time); consensus_info->last_id = state.prev_op_id; consensus_info->last_committed_id = state.committed_op_id; - consensus_info->num_log_records_replayed = state.num_entries_applied_to_rocksdb; if (data_.retryable_requests) { data_.retryable_requests->Clock().Adjust(last_entry_time); diff --git a/src/yb/tserver/ts_tablet_manager.cc b/src/yb/tserver/ts_tablet_manager.cc index 0bfbeb1758db9..82ba34d014f8e 100644 --- a/src/yb/tserver/ts_tablet_manager.cc +++ b/src/yb/tserver/ts_tablet_manager.cc @@ -1001,8 +1001,6 @@ void TSTabletManager::OpenTablet(const scoped_refptr& meta, tablet_peer->RegisterMaintenanceOps(server_->maintenance_manager()); } - num_log_records_replayed_during_bootstrap = bootstrap_info.num_log_records_replayed; - int elapsed_ms = MonoTime::Now().GetDeltaSince(start).ToMilliseconds(); if (elapsed_ms > FLAGS_tablet_start_warn_threshold_ms) { LOG(WARNING) << kLogPrefix << "Tablet startup took " << elapsed_ms << "ms"; diff --git a/src/yb/tserver/ts_tablet_manager.h b/src/yb/tserver/ts_tablet_manager.h index 720d6c990cdc3..0c3ace9d56fdb 100644 --- a/src/yb/tserver/ts_tablet_manager.h +++ b/src/yb/tserver/ts_tablet_manager.h @@ -154,8 +154,6 @@ class TSTabletManager : public tserver::TabletPeerLookupIf { ThreadPool* read_pool() const { return read_pool_.get(); } ThreadPool* append_pool() const { return append_pool_.get(); } - int64_t num_replayed() const { return num_log_records_replayed_during_bootstrap; } - // Create a new tablet and register it with the tablet manager. The new tablet // is persisted on disk and opened before this method returns. // @@ -437,9 +435,6 @@ class TSTabletManager : public tserver::TabletPeerLookupIf { // Next tablet report seqno. int32_t next_report_seq_; - // Number of log recors replayed during tablet bootstrap - int64_t num_log_records_replayed_during_bootstrap = 0; - MetricRegistry* metric_registry_; TSTabletManagerStatePB state_; diff --git a/src/yb/util/test_macros.h b/src/yb/util/test_macros.h index 2e6be32a36e20..bb13414f63a81 100644 --- a/src/yb/util/test_macros.h +++ b/src/yb/util/test_macros.h @@ -63,12 +63,6 @@ } \ } while (0) -#define ASSERT_WITHIN_INCLUSIVE(lower, upper, val) \ - do { \ - ASSERT_GE(val, lower); \ - ASSERT_LE(val, upper); \ - } while (0) - #define ASSERT_NOK(s) ASSERT_FALSE((s).ok()) #define ASSERT_OK_PREPEND(status, msg) do { \