summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYueh-Hsuan Chiang <yhchiang@fb.com>2015-05-12 16:10:23 -0700
committerYueh-Hsuan Chiang <yhchiang@fb.com>2015-05-12 16:10:23 -0700
commit14431e971d1269caf7a0bee1e4cf0220e4bdda52 (patch)
tree630b5081f887c7cbc9abc3d20cc381099fbd517a /include
parentdbd95b75321ba866195e817575e0accd2408e9ae (diff)
Fixed a bug in EventListener::OnCompactionCompleted().
Summary: Fixed a bug in EventListener::OnCompactionCompleted() that returns incorrect list of input / output file names. Test Plan: Extend existing test in listener_test.cc Reviewers: sdong, rven, igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D38349
Diffstat (limited to 'include')
-rw-r--r--include/rocksdb/listener.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/rocksdb/listener.h b/include/rocksdb/listener.h
index be5b96032..7f70d1c8e 100644
--- a/include/rocksdb/listener.h
+++ b/include/rocksdb/listener.h
@@ -45,6 +45,18 @@ struct CompactionJobInfo {
// actual thread that involves in that specific event. For example, it
// is the RocksDB background flush thread that does the actual flush to
// call EventListener::OnFlushCompleted().
+//
+// [Locking] All EventListener callbacks are designed to be called without
+// the current thread holding any DB mutex. This is to prevent potential
+// deadlock and performance issue when using EventListener callback
+// in a complex way. However, all EventListener call-back functions
+// should not run for an extended period of time before the function
+// returns, otherwise RocksDB may be blocked. For example, it is not
+// suggested to do DB::CompactFiles() (as it may run for a long while)
+// or issue many of DB::Put() (as Put may be blocked in certain cases)
+// in the same thread in the EventListener callback. However, doing
+// DB::CompactFiles() and DB::Put() in a thread other than the
+// EventListener callback thread is considered safe.
class EventListener {
public:
// A call-back function to RocksDB which will be called whenever a