Repository navigation
Closed
Milestone
Description
Version: rethinkdb 1.6.1-52-gab22ed (debug) (CLANG 3.2 (tags/RELEASE_32/final))
error: Error in src/arch/io/disk.cc at line 73:
Previous message may not have been written to the log file (cannot open or find log file).
error: Assertion failed: [outstanding_txn == 0] Closing a file with outstanding txns
Previous message may not have been written to the log file (cannot open or find log file).
error: Backtrace:
Previous message may not have been written to the log file (cannot open or find log file).
error: Wed Jun 26 01:47:37 2013
1: rethinkdb_backtrace(void**, int) at thread_stack_pcs.cc:150
2: lazy_backtrace_t::lazy_backtrace_t() at backtrace.cc:250
3: format_backtrace(bool) at backtrace.cc:197
4: report_fatal_error(char const*, int, char const*, ...) at errors.cc:67
5: linux_disk_manager_t::~linux_disk_manager_t() at disk.cc:73
6: linux_disk_manager_t::~linux_disk_manager_t() at disk.cc:74
7: linux_disk_manager_t::~linux_disk_manager_t() at disk.cc:72
8: scoped_ptr_t<linux_disk_manager_t>::reset() at scoped.hpp:66
9: scoped_ptr_t<linux_disk_manager_t>::~scoped_ptr_t() at scoped.hpp:29
10: scoped_ptr_t<linux_disk_manager_t>::~scoped_ptr_t() at scoped.hpp:30
11: io_backender_t::~io_backender_t() at disk.cc:177
12: /home/travis/build/rethinkdb/rethinkdb/build/debug_clang/rethinkdb-unittest() [0x1c14add]
13: void boost::_bi::list2<boost::_bi::value<boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)> >, boost::_bi::value<bool> >::operator()<void (*)(boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)>, bool), boost::_bi::list0>(boost::_bi::type<void>, void (*&)(boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)>, bool), boost::_bi::list0&, int) at bind.hpp:313
14: boost::_bi::bind_t<void, void (*)(boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)>, bool), boost::_bi::list2<boost::_bi::value<boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)> >, boost::_bi::value<bool> > >::operator()() at bind_template.hpp:20
15: boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, void (*)(boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)>, bool), boost::_bi::list2<boost::_bi::value<boost::function<void (namespace_interface_t<rdb_protocol_t>*, order_source_t*)> >, boost::_bi::value<bool> > >, void>::invoke(boost::detail::function::function_buffer&) at function_template.hpp:154
16: boost::function0<void>::operator()() const at function_template.hpp:759
17: starter_t::run_wrapper(boost::function<void ()> const&) at runtime.cc:53
18: boost::_mfi::mf1<void, starter_t, boost::function<void ()> const&>::operator()(starter_t*, boost::function<void ()> const&) const at mem_fn_template.hpp:165
19: void boost::_bi::list2<boost::_bi::value<starter_t*>, boost::_bi::value<boost::function<void ()> > >::operator()<boost::_mfi::mf1<void, starter_t, boost::function<void ()> const&>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf1<void, starter_t, boost::function<void ()> const&>&, boost::_bi::list0&, int) at bind.hpp:314
20: boost::_bi::bind_t<void, boost::_mfi::mf1<void, starter_t, boost::function<void ()> const&>, boost::_bi::list2<boost::_bi::value<starter_t*>, boost::_bi::value<boost::function<void ()> > > >::operator()() at bind_template.hpp:20
21: boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf1<void, starter_t, boost::function<void ()> const&>, boost::_bi::list2<boost::_bi::value<starter_t*>, boost::_bi::value<boost::function<void ()> > > >, void>::invoke(boost::detail::function::function_buffer&) at function_template.hpp:154
22: boost::function0<void>::operator()() const at function_template.hpp:759
23: callable_action_instance_t<boost::function<void ()> >::run_action() at callable_action.hpp:28
24: callable_action_wrapper_t::run() at runtime_utils.cc:67
25: coro_t::run() at coroutines.cc:178
Metadata
Metadata
Assignees
Labels
No labels
Activity
coffeemug commentedon Jun 26, 2013
I'm not sure who owns this bit, but the most likely person is @srh. So, pinging Dr @srh.
AtnNn commentedon Jul 2, 2013
Moving to 1.7.x
srh commentedon Jul 25, 2013
I have begun work on attempting to reproduce this issue in branch sam_1084 (based off v1.7.x).
srh commentedon Jul 25, 2013
I cannot find a commit with ID gab22ed. The best I can do is to try to reproduce the RDBProtocol.OvershardedMissingAttr test in the v1.6.x branch. So far, after running the test for 100 iterations in v1.7.x and 300 iterations in v1.6.x, the error has not been reproduced.
This error means that somewhere, a log serializer is shutting down without waiting for some action it has submitted to have completed. Or, it might mean that a serializer hasn't yet been destructed, or something which owns a serializer (a disk backed queue? something else?) has not yet been destructed, by the time the io_backender_t gets destroyed.
One other experiment to do is to run this unit test under valgrind. If that doesn't reveal any leaks (note that this doesn't quite mean that no leaks could possibly exist -- the error could still be outside the serializer). If that doesn't exhibit anything, the best thing I can do is to look at the code in the serializer, and look at the code in the things which use the io_backender inside rdb_protocol_t::store_t (such as the metadata store, and disk backed queues) and so on, all the way up. If I don't find anything then, I don't know what to do.
If the bug can't be fixed, a few changes could be made to improve error reporting in the future. outstanding_txn == 0 should be guaranteed, not asserted. The submitted action_t's should be put into an intrusive list, so that their contents can be dumped in some form, so that we can get some idea of which files still have activity next time this happens.
srh commentedon Jul 25, 2013
Valgrind reported a memory leak. Running valgrind with --leak-check=full resulted in a goldmine of memory leakage, probably thanks to its CPU slowdown effect.
srh commentedon Jul 31, 2013
At least the task of hunting down memory leaks is potentially confounded by extproc-related stuff. I'm going to wait for @Tryneus to merge grey_issue_1097 into next before looking at this any further.
srh commentedon Aug 6, 2013
Valgrind's memory leaks were all either protobuf or v8 noise that has now been suppressed, or one other unrelated low-severity memory leak that has been fixed. So the strategy of using valgrind to see if some serializer is being leaked somewhere has failed.
So the status of this issue is: I don't know what the problem is, and I can't reproduce the bug.
Tryneus commentedon Aug 6, 2013
This may be related to #1059, which exhibits a very similar stack trace in debug mode. I can reproduce this and that on my centos VM with
next.Tryneus commentedon Aug 7, 2013
Sooo...progress perhaps?
extent_tdoes not wait for all of itsextent_block_ts to get theirdonecallback before destructing, which might cause this error if i/o takes long enough. I'm not very familiar with the serializer code, but every other place that calls write on afile_tappears to wait for it to complete. @srh, what do you think?As an aside, this seems easier to reproduce on tests involving sindexes.
Tryneus commentedon Aug 8, 2013
Ok, that last post of mine was looking in the wrong place. It appears that the outstanding transaction is a call to
metablock_manager_t::co_write_metablockthat has not finished itsco_writecall before thelog_serializer_tdestructor is called.srh commentedon Aug 12, 2013
Reassigning to @Tryneus because he's the one who's actually been working on this.
AtnNn commentedon Oct 1, 2013
I saw this error again, in RDBBtree.SindexInterruptionViaDrop in v1.10.x:
mlucy commentedon Nov 28, 2013
@Tryneus -- what's going on with this?
coffeemug commentedon Dec 9, 2013
Pinging @Tryneus.
Tryneus commentedon Dec 9, 2013
Haven't spent any more time on this, as it would require a rather large time investment in learning the serializer for what appears to be a race condition in unit tests.
coffeemug commentedon Dec 9, 2013
Ok, I'll ask @srh to look at it when the new cache is in.
danielmewes commentedon Jan 23, 2014
I can take this.
danielmewes commentedon Jan 24, 2014
Let me add a third different backtrace to the list, because we only have two different ones so far:
Why is that interesting? Because it might hint at a possible problem with the destructor ordering in this unit test, or a place where we don't wait for a destructor to finish. I got this on CentOS with a modification that artificially & randomly delays io operations.
danielmewes commentedon Jan 24, 2014
The offending perfmon comes from the sindex mod_queue (an
internal_disk_backed_queue_t) created inbring_sindexes_up_to_date(). It uses the same io_backender as the main store, so that explains the other backtraces we have seen.Apparently the mod_queue is not always destructed before the btree store is.
danielmewes commentedon Jan 24, 2014
Hmm so we rely on the destruction order of function arguments in
post_construct_and_drain_queue(). The arguments have both anauto_drainer_t::lock_tas well as aboost::shared_ptr<internal_disk_backed_queue_t>. The latter must be destructed first. I don't know, it seems like either that doesn't work when compiling on CentOS, or a copy of the shared_ptr survives in the boost::function object for longer than the copy of the lock_t.If I remove the shared_ptr and instead use a regular pointer and wrap it into a scoped_ptr_t at the beginning of the function it works.
There is also another related place where we don't hold an
auto_drainer_t::lock_tfor long enough.danielmewes commentedon Jan 24, 2014
In code review 1152 by @Tryneus
danielmewes commentedon Jan 24, 2014
The fix has been merged into next as of commit 02c9484
and into v1.11.x as of 0e1e5d5.
I believe that this change fixes the issue. I've repeatedly run the unit tests over night and everything went well.
If it occurs again, please re-open the issue.