[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-17 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14174901#comment-14174901
 ] 

Sylvain Lebresne commented on CASSANDRA-8054:
-

I don't think that's an issue with 2.0 because there we create a new Metadata 
instance every time we construct a new ResultSet (so there is no sharing of 
anything except for the names, and those are never modified in 2.0).

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Aleksey Yeschenko
 Fix For: 2.0.11, 2.1.1

 Attachments: 8054-2.1.txt, 8054-fix.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-13 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14169297#comment-14169297
 ] 

Sylvain Lebresne commented on CASSANDRA-8054:
-

I agree that not copying the flags is an overside of the initial patch, though 
I'd really put the flag copying in the {{copy}} method. But aside that, +1.

bq. would prefer the initial Metadata have everything immutable/null in it, and 
only the Metadata returned from copy() to use mutable things

That's why my initial idea in went withCASSANDRA-7120 was to make Metadata 
basically immutable and copy to do changes, but it forces to do more copy than 
necessary and required a couple other chances. I don't mind terribly tbh.

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Sylvain Lebresne
 Fix For: 2.0.11, 2.1.1

 Attachments: 8054-2.1.txt, 8054-fix.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-13 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14170013#comment-14170013
 ] 

Aleksey Yeschenko commented on CASSANDRA-8054:
--

Pushed as 
https://github.com/apache/cassandra/commit/63cb95e012ae3cc197b42b9aa881f905449437b1
 to 2.1 and trunk, because it started to become annoying for some stress users. 
Same issue still persists in 2.0, so not closing the ticket until that one is 
fixed as well (I'll work on a fix).

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Sylvain Lebresne
 Fix For: 2.0.11, 2.1.1

 Attachments: 8054-2.1.txt, 8054-fix.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-10 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14167776#comment-14167776
 ] 

Aleksey Yeschenko commented on CASSANDRA-8054:
--

Reopening because CASSANDRA-7923 exposed another issue. Since the cached 
Metadata object has the mutable flags EnumSet (and copy() doesn't clone it), a 
request with skipMetadata=true will add the flag for any future requests, even 
without it.

And for re-prepared statements post CASSANDRA-7923 this means that for the 
second prepare after any request with skipMetadata=true, the serializer will 
skip serializing the columns when returning the PREPARED response to the client.

One option would be to simply revert CASSANDRA-7923, but since it actually 
affects more than just that, the proper fix, IMO is to copy the flags in 
Metadata#copy(). Attaching a simple patch that does that.

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Sylvain Lebresne
 Fix For: 2.1.1

 Attachments: 8054-2.1.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-10 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14167789#comment-14167789
 ] 

Aleksey Yeschenko commented on CASSANDRA-8054:
--

Same is probably true for Flag.HAS_MORE_PAGES - once set, it'll never be unset, 
since flags are shared, w/out the patch.

Not comfortable with sharing pagingState either - would prefer the initial 
Metadata have everything immutable/null in it, and only the Metadata returned 
from copy() to use mutable things.

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Sylvain Lebresne
 Fix For: 2.1.1

 Attachments: 8054-2.1.txt, 8054-fix.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-10 Thread T Jake Luciani (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14167896#comment-14167896
 ] 

T Jake Luciani commented on CASSANDRA-8054:
---

+1 fixes the issue for me. can you include the test from CASSANDRA-7923 I added 
on commit?

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Sylvain Lebresne
 Fix For: 2.0.11, 2.1.1

 Attachments: 8054-2.1.txt, 8054-fix.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-08 Thread Tyler Hobbs (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14163978#comment-14163978
 ] 

Tyler Hobbs commented on CASSANDRA-8054:


+1

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
Assignee: Sylvain Lebresne
 Attachments: 8054-2.1.txt, 8054-v2.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8054) EXECUTE request with skipMetadata=false gets no metadata in response

2014-10-03 Thread Michael Penick (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14158500#comment-14158500
 ] 

Michael Penick commented on CASSANDRA-8054:
---

This is not an issue in 2.0 because it makes a new copy per request:
https://github.com/apache/cassandra/blob/cassandra-2.0/src/java/org/apache/cassandra/cql3/statements/Selection.java#L61

 EXECUTE request with skipMetadata=false gets no metadata in response
 

 Key: CASSANDRA-8054
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8054
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Olivier Michallat
 Attachments: 8054-2.1.txt


 This has been reported independently with the 
 [Java|https://datastax-oss.atlassian.net/browse/JAVA-482] and 
 [C++|https://datastax-oss.atlassian.net/browse/CPP-174] drivers.
 This happens under heavy load, where multiple client threads prepare and 
 execute statements in parallel. One of them sends an EXECUTE request with 
 skipMetadata=false, but the returned ROWS response has no metadata in it.
 A patch of {{Message.Dispatcher.channelRead0}} confirmed that the flag was 
 incorrectly set on the response:
 {code}
 logger.debug(Received: {}, v={}, request, 
 connection.getVersion());
 boolean skipMetadataOnRequest = false;
 if (request instanceof ExecuteMessage) {
 ExecuteMessage execute = (ExecuteMessage)request;
 skipMetadataOnRequest = execute.options.skipMetadata();
 }
 response = request.execute(qstate);
 if (request instanceof ExecuteMessage) {
 Rows rows = (Rows)response;
 boolean skipMetadataOnResponse = 
 rows.result.metadata.flags.contains(Flag.NO_METADATA);
 if (skipMetadataOnResponse != skipMetadataOnRequest) {
 logger.warn(Inconsistent skipMetadata on streamId 
 {}, was {} in request but {} in response,
 request.getStreamId(),
 skipMetadataOnRequest,
 skipMetadataOnResponse);
 }
 }
 {code}
 We observed the warning with (false, true) during our tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)