Skip to content

Commit

Permalink
Reply bug fixed: shouldn't check for table's existence
Browse files Browse the repository at this point in the history
  • Loading branch information
arpang committed Jan 26, 2023
1 parent 4f8b8ba commit 26f7fb0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/yb/tablet/tablet_bootstrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1487,20 +1487,21 @@ class TabletBootstrap {
consensus::LWReplicateMsg* replicate_msg,
AlreadyAppliedToRegularDB already_applied_to_regular_db) {
auto* request = replicate_msg->mutable_change_metadata_request();

LOG_WITH_FUNC(INFO) << "Inside PlayChangeMetadataRequest";
ChangeMetadataOperation operation(tablet_, log_.get(), request);

// If table id isn't in metadata, ignore the replay as the table might've been dropped.
auto table_info = meta_->GetTableInfo(operation.table_id().ToBuffer());
if (!table_info.ok()) {
LOG_WITH_PREFIX(WARNING) << "Table ID " << operation.table_id()
<< " not found in metadata, skipping this ChangeMetadataRequest";
return Status::OK();
}
// auto table_info = meta_->GetTableInfo(operation.table_id().ToBuffer());
// if (!table_info.ok()) {
// LOG_WITH_PREFIX(WARNING) << "Table ID " << operation.table_id()
// << " not found in metadata, skipping this ChangeMetadataRequest";
// return Status::OK();
// }

RETURN_NOT_OK(operation.Prepare(IsLeaderSide::kTrue));

if (tablet_->metadata()->IsTableMetadataInRocksDB()) {
LOG_WITH_FUNC(INFO) << "Playing ChangeMetadataRequest";
operation.set_op_id(OpId::FromPB(replicate_msg->id()));
HybridTime hybrid_time(replicate_msg->hybrid_time());
operation.set_hybrid_time(hybrid_time);
Expand Down

0 comments on commit 26f7fb0

Please sign in to comment.