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 when converting stream to array: Guarantee failed: [data.size() == 0] #3767

Closed
Tryneus opened this issue Feb 12, 2015 · 5 comments
Closed
Assignees
Milestone

Comments

@Tryneus
Copy link
Member

Tryneus commented Feb 12, 2015

In next, ran this query (using the python client):

r.range(1000).concat_map([r.row]).coerce_to('ARRAY').run(c)

Got this crash:

Version: rethinkdb 1.16.0-1-95-g6f9f6d-dirty (debug) (GCC 4.6.3)
error: Error in ../src/rdb_protocol/datum_stream.cc at line 815:
error: Guarantee failed: [data.size() == 0]
error: Backtrace:
error: Wed Feb 11 16:33:20 2015

       1: rethinkdb_backtrace(void**, int) at rethinkdb_backtrace.cc:101
       2: backtrace_t::backtrace_t() at backtrace.cc:203
       3: lazy_backtrace_formatter_t::lazy_backtrace_formatter_t() at backtrace.cc:283
       4: format_backtrace(bool) at backtrace.cc:198
       5: report_fatal_error(char const*, int, char const*, ...) at errors.cc:83
       6: ql::eager_datum_stream_t::accumulate_all(ql::env_t*, ql::eager_acc_t*) at datum_stream.cc:815
       7: ql::datum_stream_t::to_array(ql::env_t*) at datum_stream.cc:701
       8: ql::coerce_term_t::eval_impl(ql::scope_env_t*, ql::args_t*, ql::eval_flags_t) const at type_manip.cc:233
       9: ql::op_term_t::term_eval(ql::scope_env_t*, ql::eval_flags_t) const at op.cc:217
       10: ql::runtime_term_t::eval(ql::scope_env_t*, ql::eval_flags_t) const at term.cc:444
       11: ql::run(ql::protob_t<Query>, rdb_context_t*, signal_t*, ql::stream_cache_t*, ip_and_port_t const&, Response*) at term.cc:263
       12: rdb_query_server_t::run_query(ql::protob_t<Query> const&, Response*, signal_t*, client_context_t*, ip_and_port_t const&) at query_server.cc:62
@Tryneus Tryneus added this to the 2.0 milestone Feb 12, 2015
@Tryneus
Copy link
Member Author

Tryneus commented Feb 12, 2015

This also exists on v1.16.x.

@Tryneus Tryneus modified the milestones: 1.16.x, 2.0 Feb 12, 2015
@Tryneus
Copy link
Member Author

Tryneus commented Feb 12, 2015

This appears to be because r.range(...) does not respect batchspec_t::all() by adding a .with_at_most(500) to the end. This would suggest that accumulating any r.range(...) stream larger than 500 elements would fail. The good news is that this is an r_sanity_check, so it won't crash the release server.

@VeXocide
Copy link
Member

This was added as a performance optimisation since generating the first batch felt relatively slow. I'll take care of it by either simply removing it, or not applying it if we're in a batchspec_t::all().

@VeXocide VeXocide self-assigned this Feb 12, 2015
@Tryneus
Copy link
Member Author

Tryneus commented Feb 12, 2015

@VeXocide, sorry I actually already fixed this, just got interrupted before I could put it up for review. Now in review 2595.

@Tryneus
Copy link
Member Author

Tryneus commented Feb 12, 2015

The fix has been approved and merged into v1.16.x in commit bcab24c, and cherry-picked into next in commit eec7134. Will be in release 1.16.2.

@Tryneus Tryneus closed this as completed Feb 12, 2015
@Tryneus Tryneus assigned Tryneus and unassigned VeXocide Feb 12, 2015
@AtnNn AtnNn modified the milestones: 1.16.x, 1.16.2 Feb 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants