[SERVER-15705] (rocksdb) numRecords and numEntries to work with recovery unit Created: 17/Oct/14  Updated: 28/Apr/15  Resolved: 17/Oct/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 2.7.8

Type: Bug Priority: Major - P3
Reporter: Siying Dong Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File atomic_counters.patch     Text File atomic_counters_v2.patch    
Issue Links:
Tested
Operating System: ALL
Participants:

 Description   

In rocks engine, now numRecords and numEntries are not updated atomically in recovery unit commit time. This patch fix it by caching all the counter delta in rocks recovery unit and update time in commit, to both of memory and DB.

Patch attached



 Comments   
Comment by Githook User [ 17/Oct/14 ]

Author:

{u'username': u'siying', u'name': u'sdong', u'email': u'siying.d@fb.com'}

Message: SERVER-15705 (rocksdb) fixed numRecords and numEntries to work with recovery unit

Signed-off-by: Benety Goh <benety@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/898643d46da8916f77933c9e1de2de16e5efe46f

Comment by Matt Kangas [ 17/Oct/14 ]

Tested atomic_counters_v2.patch, this fixes storage_rocks_sorted_data_impl_test but storage_rocks_engine_test fails

mongo::printStackTrace(std::ostream&) at /data02/workspace/mongo/src/mongo/util/stacktrace_posix.cpp:104
mongo::(anonymous namespace)::printSignalAndBacktrace(int) at /data02/workspace/mongo/src/mongo/util/signal_handlers_synchronous.cpp:124
mongo::(anonymous namespace)::abruptQuit(int) at /data02/workspace/mongo/src/mongo/util/signal_handlers_synchronous.cpp:146
??
??:0
??
??:0
??
??:0
_ZN7rocksdb4portL11PthreadCallEPKci.part.0 at port_posix.cc:0
rocksdb::port::Mutex::Unlock() at /home/kangas/workspace/rocksdb/port/port_posix.cc:59
rocksdb::ColumnFamilyHandleImpl::~ColumnFamilyHandleImpl() at /home/kangas/workspace/rocksdb/db/column_family.cc:76
rocksdb::ColumnFamilyHandleImpl::~ColumnFamilyHandleImpl() at /home/kangas/workspace/rocksdb/db/column_family.cc:85
void boost::checked_delete<rocksdb::ColumnFamilyHandle>(rocksdb::ColumnFamilyHandle*) at /data02/workspace/mongo/src/third_party/boost/boost/checked_delete.hpp:40
boost::detail::sp_counted_impl_p<rocksdb::ColumnFamilyHandle>::dispose() at /data02/workspace/mongo/src/third_party/boost/boost/smart_ptr/detail/sp_counted_impl.hpp:79
boost::detail::sp_counted_base::release() at /data02/workspace/mongo/src/third_party/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146
boost::detail::shared_count::~shared_count() at /data02/workspace/mongo/src/third_party/boost/boost/smart_ptr/detail/shared_count.hpp:309
boost::shared_ptr<rocksdb::ColumnFamilyHandle>::~shared_ptr() at /data02/workspace/mongo/src/third_party/boost/boost/smart_ptr/shared_ptr.hpp:164
mongo::RocksRecordStore::~RocksRecordStore() at /data02/workspace/mongo/src/mongo/db/storage/rocks/rocks_record_store.h:63
mongo::RocksRecordStore::~RocksRecordStore() at /data02/workspace/mongo/src/mongo/db/storage/rocks/rocks_record_store.h:63
void boost::checked_delete<mongo::RecordStore>(mongo::RecordStore*) at /data02/workspace/mongo/src/third_party/boost/boost/checked_delete.hpp:40
boost::scoped_ptr<mongo::RecordStore>::~scoped_ptr() at /data02/workspace/mongo/src/third_party/boost/boost/smart_ptr/scoped_ptr.hpp:81
boost::scoped_ptr<mongo::RecordStore>::reset(mongo::RecordStore*) at /data02/workspace/mongo/src/third_party/boost/boost/smart_ptr/scoped_ptr.hpp:86
mongo::UnitTest__KVEngineTestHarness__Restart1::_doTest() at /data02/workspace/mongo/src/mongo/db/storage/kv/kv_engine_test_harness.cpp:118
mongo::unittest::Test::run() at /data02/workspace/mongo/src/mongo/unittest/unittest.cpp:144
void mongo::unittest::Suite::runTestObject<mongo::UnitTest__KVEngineTestHarness__Restart1>() at /data02/workspace/mongo/src/mongo/unittest/unittest.h:367
std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) at /usr/include/c++/4.8/functional:2073
std::function<void ()>::operator()() const at /usr/include/c++/4.8/functional:2469
mongo::unittest::TestHolder::run() const at /data02/workspace/mongo/src/mongo/unittest/unittest.h:238
mongo::unittest::Suite::run(std::string const&, int) at /data02/workspace/mongo/src/mongo/unittest/unittest.cpp:223
mongo::unittest::Suite::run(std::vector<std::string, std::allocator<std::string> > const&, std::string const&, int) at /data02/workspace/mongo/src/mongo/unittest/unittest.cpp:289
main at /data02/workspace/mongo/src/mongo/unittest/unittest_main.cpp:40

Comment by Siying Dong [ 17/Oct/14 ]

Forgot to mention atomic_counters_v2.patch is against 4e10def7b1ea9da02a5218d592073ff2587544cd

Comment by Siying Dong [ 17/Oct/14 ]

Fix rocks_sorted_data_impl_test and the unused variable. atomic_counters_v2.patch uploaded.

Comment by Siying Dong [ 17/Oct/14 ]

This should work.

Comment by Siying Dong [ 17/Oct/14 ]

Still seems to be not working, trying to figure out how to format the patch.

Comment by Siying Dong [ 17/Oct/14 ]

Re-post the patch.

Generated at Thu Feb 08 03:38:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.