Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geo: TS crash when accessing nonlocal data in a local transaction #10879

Closed
es1024 opened this issue Dec 15, 2021 · 1 comment
Closed

geo: TS crash when accessing nonlocal data in a local transaction #10879

es1024 opened this issue Dec 15, 2021 · 1 comment
Assignees
Labels
area/docdb YugabyteDB core features

Comments

@es1024
Copy link
Contributor

es1024 commented Dec 15, 2021

Description

Context: #9980

When attempting to access nonlocal data in a local transaction, sometimes the tablet server crashes instead of cleanly aborting the transaction:

yugabyte=# begin; insert into testb values(7); end;
BEGIN
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
You are currently not connected to a database.
@es1024 es1024 added the area/docdb YugabyteDB core features label Dec 15, 2021
@es1024 es1024 self-assigned this Dec 15, 2021
es1024 added a commit that referenced this issue Jan 17, 2022
…transaction

Summary:
Fixed the TS exiting due to accessing a null pointer instead of cleanly aborting a
local transaction that attempts to access nonlocal data.

Test Plan: Added `ybd --cxx-test pgwrapper_geo_transactions-test --gtest_filter GeoTransactionsTest.TestNonlocalAbort` to repeatedly trying to run transactions that accesses nonlocal data while under `force_global_transaction = false` to ensure that the TS no longer crashes.

Reviewers: bogdan, mbautin, sergei

Reviewed By: sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D14375
@es1024 es1024 closed this as completed Jan 18, 2022
es1024 added a commit that referenced this issue Feb 2, 2022
…ta from a local transaction

Summary:
Fixed the TS exiting due to accessing a null pointer instead of cleanly aborting a
local transaction that attempts to access nonlocal data.

Original Commit: D14375 / b3520e8

Test Plan:
Jenkins: rebase: 2.12, urgent

`ybd --cxx-test pgwrapper_geo_transactions-test --gtest_filter GeoTransactionsTest.TestNonlocalAbort`

Reviewers: bogdan, mbautin, sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D15195
@rthallamko3
Copy link
Contributor

Segmentation faults that happen due to this issue, can have the following callstack:
#3 yb::client::YBTransaction::Impl::DoAbort (this=this@entry=0x21a42c0, deadline=..., deadline@entry=..., transaction=std::shared_ptr (count 8, weak 1) 0x219b8a0, status_tablet=...)
at ../../src/yb/client/transaction.cc:832
#4 0x00007f56c01670cd in yb::client::YBTransaction::Impl::DoAbort (this=this@entry=0x21a42c0, deadline=..., transaction=std::shared_ptr (count 8, weak 1) 0x219b8a0) at ../../src/yb/client/transaction.cc:824
#5 0x00007f56c0167549 in yb::client::YBTransaction::Impl::Prepare(yb::client::internal::InFlightOpsGroupsWithMetadata*, yb::StronglyTypedBoolyb::client::ForceConsistentRead_Tag, std::chrono::time_point<yb::CoarseMo
noClock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, yb::StronglyTypedBoolyb::client::Initial_Tag, boost::function<void (yb::Status const&)>) (warning: Source file is more recent than executable.
this=this@entry=0x21a42c0,
ops_info=ops_info@entry=0x1f9e738, force_consistent_read=..., deadline=..., initial=..., initial@entry=..., waiter=...) at ../../src/yb/client/transaction.cc:322
#6 0x00007f56c009b871 in yb::client::internal::Batcher::ExecuteOperations (this=0x1f9e690, initial=...) at ../../src/yb/client/batcher.cc:483
#7 0x00007f56c00a018e in yb::client::internal::Batcher::AllLookupsDone (this=this@entry=0x1f9e690) at ../../src/yb/client/batcher.cc:471
---Type to continue, or q to quit---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features
Projects
None yet
Development

No branches or pull requests

2 participants