From 63bae603f4befa1679f12f42bfaee9c82ef7a3e7 Mon Sep 17 00:00:00 2001 From: Sergei Politov Date: Thu, 29 Nov 2018 23:33:12 +0300 Subject: [PATCH] This commit provides additional functionality that is logically related to the earlier commit https://github.com/YugaByte/yugabyte-db/commit/566d6d2209f0d4cb518a4bb4db25e94b0aeb1f6e Original commit message: ENG-4240: #613: Fix checking of tablet presence during transaction CLEANUP Summary: We were failing to check the return code of the function `LookupTablePeerOrRespond` when CLEANUP request is received by tablet service. This was causing the following FATAL right after restart during software upgrade on a cluster with SecondaryIndex workload. ```#0 yb::tserver::TabletServiceImpl::CheckMemoryPressure (this=this@entry=0x24c2e00, tablet=tablet@entry=0x0, resp=resp@entry=0x14d3d410, context=context@entry=0x7f55b1eb5600) at ../../src/yb/tserver/tablet_service.cc:222 #1 0x00007f55d4c8a881 in yb::tserver::TabletServiceImpl::UpdateTransaction (this=this@entry=0x24c2e00, req=req@entry=0x1057aa90, resp=resp@entry=0x14d3d410, context=...) at ../../src/yb/tserver/tablet_service.cc:431 #2 0x00007f55d273f28a in yb::tserver::TabletServerServiceIf::Handle (this=0x24c2e00, call=...) at src/yb/tserver/tserver_service.service.cc:267 #3 0x00007f55cff0a3ea in yb::rpc::ServicePoolImpl::Handle (this=0x27ca540, incoming=...) at ../../src/yb/rpc/service_pool.cc:214``` Changed LookupTablePeerOrRespond to return complete result using return value. Test Plan: Update xdc-user-identity and check that is does not crash and workload is stable. Reviewers: robert, hector, mikhail, kannan Reviewed By: mikhail, kannan Subscribers: kannan, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D5772 --- ent/src/yb/integration-tests/transaction-ent-test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ent/src/yb/integration-tests/transaction-ent-test.cc b/ent/src/yb/integration-tests/transaction-ent-test.cc index 8f9928741248..a0a1dd672164 100644 --- a/ent/src/yb/integration-tests/transaction-ent-test.cc +++ b/ent/src/yb/integration-tests/transaction-ent-test.cc @@ -75,7 +75,7 @@ TEST_F(TransactionEntTest, RandomErrorClock) { RandomErrorClockShare share; for (int32_t key = 0; key != share.values.size(); ++key) { share.values[key].store(0, std::memory_order_release); - WriteRow(CreateSession(), key, 0); + ASSERT_OK(WriteRow(CreateSession(), key, 0)); } while (threads.size() < share.values.size()) { @@ -88,7 +88,10 @@ TEST_F(TransactionEntTest, RandomErrorClock) { session->SetTransaction(transaction); auto value = share.values[key].load(std::memory_order_acquire); auto new_value = value + 1; - WriteRow(session, key, new_value); + auto write_result = WriteRow(session, key, new_value); + if (!write_result.ok()) { + continue; + } auto status = transaction->CommitFuture().get(); if (status.ok()) { share.values[key].store(new_value, std::memory_order_release);