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

[CDC] SIGSEGV due to null consensus pointer in GetChanges #3289

Closed
ajcaldera1 opened this issue Jan 8, 2020 · 1 comment
Closed

[CDC] SIGSEGV due to null consensus pointer in GetChanges #3289

ajcaldera1 opened this issue Jan 8, 2020 · 1 comment
Assignees
Labels
area/cdc Change Data Capture

Comments

@ajcaldera1
Copy link
Contributor

Found during CDC testing on producer node:

#0 0x00007fa7a002f9f3 in yb::cdc::CDCServiceImpl::GetChanges (this=this@entry=0x281a2c0, req=req@entry=0x48db910, resp=resp@entry=0xa5c2dd60, context=...) at ../../ent/src/yb/cdc/cdc_service.cc:367
#1 0x00007fa79fdc1b9b in yb::cdc::CDCServiceIf::Handle (this=0x281a2c0, call=...) at src/yb/cdc/cdc_service.service.cc:142
#2 0x00007fa79a17dcd9 in yb::rpc::ServicePoolImpl::Handle (this=0x28fdb00, incoming=...) at ../../src/yb/rpc/service_pool.cc:262
#3 0x00007fa79a121f44 in yb::rpc::InboundCall::InboundCallTask::Run (this=) at ../../src/yb/rpc/inbound_call.cc:212
#4 0x00007fa79a189928 in yb::rpc::(anonymous namespace)::Worker::Execute (this=) at ../../src/yb/rpc/thread_pool.cc:99
#5 0x00007fa79873857f in operator() (this=0xb3465f8) at /home/yugabyte/yb-software/yugabyte-2.0.10.0-217ffbcec74db/Cellar/gcc/5.5.0_4/include/c++/5.5.0/functional:2267
#6 yb::Thread::SuperviseThread (arg=0xb3465a0) at ../../src/yb/util/thread.cc:739
#7 0x00007fa79317e694 in start_thread (arg=0x7fa6eb5f2700) at pthread_create.c:333
#8 0x00007fa7928bb41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

@ajcaldera1 ajcaldera1 added the area/cdc Change Data Capture label Jan 8, 2020
@ajcaldera1 ajcaldera1 added this to To Do in YBase features via automation Jan 8, 2020
@hectorgcr
Copy link
Contributor

hectorgcr commented Jan 8, 2020

This is related to the line

tablet_peer->consensus()->UpdateCDCConsumerOpId(GetMinSentCheckpointForTablet(req->tablet_id()));

TabletPeer::consensus returns a raw pointer, and this pointer was null:

has_consensus_ = {_M_base = {static _S_alignment = 1, _M_i = false}}
consensus_ = {<std::__shared_ptr<yb::consensus::RaftConsensus, (__gnu_cxx::_Lock_policy)2>> = {_M_ptr = 0x0, _M_refcount = {_M_pi = 0x0}}

We need to change consensus() to shared_consensus()

hectorgcr added a commit that referenced this issue Jan 23, 2020
Summary:
Check that consensus object is not null before accessing it

Test Plan: unit tests

Reviewers: bogdan, nicolas, rahuldesirazu, neha

Reviewed By: neha

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D7793
YBase features automation moved this from To Do to Done Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cdc Change Data Capture
Projects
Development

No branches or pull requests

2 participants