Metadata not present on rows result

Description

The following crash can be reproduced by creating the same prepared statement on several client threads then using them to execute a statement. The preparing step works as intended, but some of the prepares don't return the "<result_metadata>" section which is specified in the protocol (https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v2.spec#L565-L572) and handled correctly. The execute requests handle this scenario by not setting the "skip_metadata" flag (https://github.com/datastax/cpp-driver/blob/1.0/src/execute_request.hpp#L36-L40). I've been able to replicate a situation where the "skip_metadata" flag is not set, but the metadata doesn't get returned. I'm not sure if this is a driver or C* issue yet.

Note: assert(execute->skip_metadata())

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdf5fe700 (LWP 14601)]
0x00007ffff796acee in std::vector<cass::ColumnDefinition, cass::FixedAllocator<cass::ColumnDefinition, 16u> >::size (this=0x8)
at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_vector.h:533
533 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_vector.h: No such file or directory.
in /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_vector.h
(gdb) bt
#0 0x00007ffff796acee in std::vector<cass::ColumnDefinition, cass::FixedAllocator<cass::ColumnDefinition, 16u> >::size (this=0x8)
at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_vector.h:533
#1 0x00007ffff796a490 in cass::Metadata::column_count (this=0x0)
at /ws/kkingdon-sjc/cql/cds/imports/cassandra/cpp-driver/src/metadata.hpp:91
#2 0x00007ffff796a556 in cass::ResultResponse::column_count (this=
0x7fff6c001ee0)
at /ws/kkingdon-sjc/cql/cds/imports/cassandra/cpp-driver/src/result_response.hpp:61
#3 0x00007ffff798a462 in cass::ResultResponse::decode_first_row (
this=0x7fff6c001ee0)
at /ws/kkingdon-sjc/cql/cds/imports/cassandra/cpp-driver/src/result_response.cpp:171
#4 0x00007ffff797216c in cass_future_get_result (future=0x7fffd40d7fc0)
at /ws/kkingdon-sjc/cql/cds/imports/cassandra/cpp-driver/src/future.cpp:78
#5 0x000000000041ce34 in COS:bRequest::finishInvokeLookup (
this=0x7fffd402b4f0) at Database.cpp:1519
#6 0x000000000041cc9b in COS:bRequest::finishInvoke (this=0x7fffd402b4f0)
at Database.cpp:1459
#7 0x000000000041f59e in COS:b::onReadyCb (loop=0x66a550, w=0x668388,
revents=524288) at Database.cpp:2432
#8 0x00007ffff72c2efe in ev_invoke_pending (loop=0x66a550) at ev.c:2994
#9 0x00007ffff72c6fcf in ev_run (loop=0x66a550, flags=<value optimized out>)
at ev.c:3394
#10 0x0000000000437c3a in COS::TaskDispatcher::init (this=0x668278)
at TaskDispatcher.cpp:65
#11 0x00000000004382f2 in COS::TaskThread::main (thread_=0x668278)
at TaskThread.cpp:43
#12 0x00007ffff70a8851 in start_thread () from /lib64/libpthread.so.0
#13 0x00007ffff665690d in clone () from /lib64/libc.so.6

Environment

None

Pull Requests

None

Activity

Show:
Olivier Michallat
October 3, 2014, 9:19 AM

Great, I'll try that tomorrow. Do you use a multi-node cluster or would that also work with a single instance?

Michael Penick
October 4, 2014, 12:54 AM
Edited

This is reproducible with a single node cluster and is only reproducible with C* 2.1. I have been unable to reproduce with C* 2.0. This is also not an issue with C* 1.2 because it's prepare result response never returns "<result_metadata>", but it should be noted that it always returns "<metadata>" for the row result response.

Michael Penick
October 4, 2014, 6:32 AM
Michael Penick
November 1, 2014, 7:40 AM
Michael Penick
November 14, 2014, 3:04 AM

Manually tested against Cassandra 2.1.0. Scenario: Prepare the same statement in several threads. The error: "Expected metadata but no metadata in response" is prints, no set fault..

Fixed

Assignee

Unassigned

Reporter

Michael Penick

Labels

None

PM Priority

None

Reproduced in

None

External issue ID

None

Doc Impact

None

Reviewer

None

Pull Request

None

Size

None

Fix versions

Priority

Major