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

Crash during flush triggered by memory monitor #2010

Closed
ttyusupov opened this issue Aug 9, 2019 · 1 comment
Closed

Crash during flush triggered by memory monitor #2010

ttyusupov opened this issue Aug 9, 2019 · 1 comment
Assignees
Labels
kind/bug This issue is a bug

Comments

@ttyusupov
Copy link
Contributor

ttyusupov commented Aug 9, 2019

From core file:

Core was generated by `/home/yugabyte/tserver/bin/yb-tserver --flagfile /home/yugabyte/tserver/conf/se'.
Program terminated with signal 11, Segmentation fault.
#0  GetSmallestFrontierLocked (this=<optimized out>) at ../../src/yb/rocksdb/db/memtable.h:354
354    ../../src/yb/rocksdb/db/memtable.h: No such file or directory.
  UserFrontierPtr GetSmallestFrontierLocked() const {
    std::lock_guard<SpinMutex> l(frontiers_mutex_);
354:    return frontiers_->Smallest().Clone(); 
  }

Here frontiers_ maybe not yet initialized. GetSmallestFrontierLocked is only called from code path flushing when we hit global memtable memory limit and there is a check above that call for !mem->IsEmpty(), so memtable shouldn’t be empty.

Checked the core file and confirmed that there was non-empty memtable for intents DB with not initialized frontiers.

By design frontiers_ should be initialized when memtable is not empty, so there is some bug in frontiers_ initialization which leads to crash together with missed check for frontiers_ to be initialized inside GetSmallestFrontierLocked().

@ttyusupov ttyusupov added the kind/bug This issue is a bug label Aug 9, 2019
@ttyusupov ttyusupov self-assigned this Aug 9, 2019
@spolitov
Copy link
Contributor

spolitov commented Aug 9, 2019

This bug is related to 1.2.
Remove intents of aborted transaction could result in non empty memtable of intents DB with NULL frontiers.
D6860 (#1240) changed logic of remove intents, so this issue does not exist in 1.3.

ttyusupov added a commit that referenced this issue Aug 11, 2019
…tSmallestFrontierLocked

Summary:
More details about the issue are described in #2010.
This revision adds a check for `frontiers_` into `DBImpl::GetSmallestFrontierLocked` and also warning and debug fatal logs when frontiers are not initialized for non-empty memtable inside `DBImpl::GetMutableMemTableSmallestFrontier` since this should not happen.

Test Plan: Jenkins

Reviewers: bogdan, sergei

Reviewed By: sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D7033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants