Skip to content

Commit

Permalink
ENG-4240: yugabyte#613: Fix checking of tablet presence during transa…
Browse files Browse the repository at this point in the history
…ction 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<yb::tserver::UpdateTransactionResponsePB> (this=this@entry=0x24c2e00, tablet=tablet@entry=0x0,
    resp=resp@entry=0x14d3d410, context=context@entry=0x7f55b1eb5600) at ../../src/yb/tserver/tablet_service.cc:222
yugabyte#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
yugabyte#2  0x00007f55d273f28a in yb::tserver::TabletServerServiceIf::Handle (this=0x24c2e00, call=...) at src/yb/tserver/tserver_service.service.cc:267
yugabyte#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

Note:
This commit provides additional functionality that is logically related to
the earlier commit yugabyte@566d6d2
and supersedes the commit yugabyte@63bae60
  • Loading branch information
spolitov committed Jul 16, 2019
1 parent 1e0bc1a commit a24349c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ent/src/yb/integration-tests/transaction-ent-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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);
Expand Down

0 comments on commit a24349c

Please sign in to comment.