5c19a441c4
Summary: This PR implements a fault injection mechanism for injecting errors in reads in db_stress. The FaultInjectionTestFS is used for this purpose. A thread local structure is used to track the errors, so that each db_stress thread can independently enable/disable error injection and verify observed errors against expected errors. This is initially enabled only for Get and MultiGet, but can be extended to iterator as well once its proven stable. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6538 Test Plan: crash_test make check Reviewed By: riversand963 Differential Revision: D20714347 Pulled By: anand1976 fbshipit-source-id: d7598321d4a2d72bda0ced57411a337a91d87dc7
29 lines
891 B
C++
29 lines
891 B
C++
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
// (found in the LICENSE.Apache file in the root directory).
|
|
//
|
|
#pragma once
|
|
|
|
#include "rocksdb/rocksdb_namespace.h"
|
|
|
|
namespace ROCKSDB_NAMESPACE {
|
|
namespace port {
|
|
|
|
// Install a signal handler to print callstack on the following signals:
|
|
// SIGILL SIGSEGV SIGBUS SIGABRT
|
|
// Currently supports linux only. No-op otherwise.
|
|
void InstallStackTraceHandler();
|
|
|
|
// Prints stack, skips skip_first_frames frames
|
|
void PrintStack(int first_frames_to_skip = 0);
|
|
|
|
// Prints the given callstack
|
|
void PrintAndFreeStack(void* callstack, int num_frames);
|
|
|
|
// Save the current callstack
|
|
void* SaveStack(int* num_frame, int first_frames_to_skip = 0);
|
|
|
|
} // namespace port
|
|
} // namespace ROCKSDB_NAMESPACE
|