You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (Created) (JIRA)" <ji...@apache.org> on 2011/10/04 11:06:33 UTC

[jira] [Created] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Short reads protection results in returning more columns than asked for
-----------------------------------------------------------------------

                 Key: CASSANDRA-3303
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0.0
            Reporter: Sylvain Lebresne
            Priority: Minor
             Fix For: 1.0.0


When we detect a short read (in SP.fetchRows), we retry a new command created by:
{noformat}
logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
                                                             command.key,
                                                             command.queryPath,
                                                             sliceCommand.start,
                                                             sliceCommand.finish,
                                                             sliceCommand.reversed,
                                                             retryCount);
{noformat}
That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Clark updated CASSANDRA-3303:
-----------------------------------

    Attachment: cassandra-3303-5.patch

[^cassandra-3303-5.patch] addresses all the comments in the most recent review. Additionally, it checks for a long read on SliceFromReadCommand instead of just RetriedSliceFromReadCommand.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, cassandra-3303-4.patch, cassandra-3303-5.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130325#comment-13130325 ] 

Byron Clark commented on CASSANDRA-3303:
----------------------------------------

[^long_read.sh] is the script I'm using with ccm to reproduce the issue.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Clark updated CASSANDRA-3303:
-----------------------------------

    Attachment: cassandra-3303-1.patch

[^cassandra-3303-1.patch] is a first attempt at fixing this.  I'm not sure it handles the situation correctly a slice requested in reverse order.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: cassandra-3303-1.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13140607#comment-13140607 ] 

Jonathan Ellis commented on CASSANDRA-3303:
-------------------------------------------

So, we should wait before reviewing?
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Sylvain Lebresne (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142194#comment-13142194 ] 

Sylvain Lebresne commented on CASSANDRA-3303:
---------------------------------------------

On the patch, a few minor remarks:
* There is a weird UnImplNode on top of ReadCommand.java (that prevents compilation)
* I think we could replace isLongRead and trimLongRead by a maybeTrim() method that would be a noop by default. Basically trimLongRead requires that isLongRead() has been called (otherwise it throws an unsupported exception), so in those case I think it's easier to use if it's just one method. Same for the pair (isShortRead, generateShortRetry) actually.
* nit: There is some imports rewrite (java.io.* -> multiple imports) in SFRC. It's a big deal but that kind of thing makes diffs bigger than necessary so it's nice to take the habit to no do that.

Now I don't think this patch addresses CASSANDRA-3395 as is. For that, we would basically need to move the trimLongRead to SliceFromReadCommand directly (the bug of CASSANDRA-3395 is that normal SliceFromReadCommand can have more that requested columns because of reconciliation of the result of different nodes). The easiest way here is probably to move the trim code to a SliceFromReadCommand.maybeTrim() and to have that method uses some getRequestedCount() method. For SFRC, the latter method would return count, for RSFRC, it would return originalCount.

                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, cassandra-3303-4.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141350#comment-13141350 ] 

Jonathan Ellis commented on CASSANDRA-3303:
-------------------------------------------

Belatedly and probably redundantly, I note that any time we hit RowRepairResolver we can have this count problem, not just w/ short read resolution.  (E.g., CASSANDRA-3395)
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Clark updated CASSANDRA-3303:
-----------------------------------

    Attachment: cassandra-3303-3.patch

[^casssandra-3303-3.patch] should address all the concerns mentioned. 

I'm going to go ahead and pull some more of the logic out of StorageProxy and get rid of all the instanceof checks.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130345#comment-13130345 ] 

Byron Clark edited comment on CASSANDRA-3303 at 10/19/11 4:20 AM:
------------------------------------------------------------------

[^cassandra-3303-1.patch] is a first attempt at fixing this.  I'm not sure it handles the situation correctly for a slice requested in reverse order.
                
      was (Author: byronclark):
    [^cassandra-3303-1.patch] is a first attempt at fixing this.  I'm not sure it handles the situation correctly a slice requested in reverse order.
                  
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: cassandra-3303-1.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3303:
--------------------------------------

    Fix Version/s:     (was: 1.0.0)
                   1.0.1
         Assignee: Byron Clark

Tagging this 1.0.1 since short reads being broken is nothing new (I would say returning too much data, is better than returning not enough)
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Sylvain Lebresne (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131659#comment-13131659 ] 

Sylvain Lebresne commented on CASSANDRA-3303:
---------------------------------------------

This doesn't always work, because we cannot be sure that on the retry phase, we will have a digest mismatch again (some read repair could have kicked in). I.e, we should also trim also in the initial for loop, not only in the 'deal with repair response' one.

Also (and I'm nitpicking a bit) it would be nice to push the trim code into RetriedSliceFromReadCommand (and to make it handle reversed queries). For instance we could add a filter(ColumFamily) method or something like that. Same thing for the original count, rather than using instanceof, I'd rather add a originalCount() method to SliceFromReadCommand (that would return count) that the Retried variant would override.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130325#comment-13130325 ] 

Byron Clark edited comment on CASSANDRA-3303 at 10/19/11 3:04 AM:
------------------------------------------------------------------

[^long_read.sh] is the script I'm using with ccm to reproduce the issue. It's the same script used for CASSANDRA-2643.
                
      was (Author: byronclark):
    [^long_read.sh] is the script I'm using with ccm to reproduce the issue.
                  
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139520#comment-13139520 ] 

Byron Clark edited comment on CASSANDRA-3303 at 11/1/11 2:58 PM:
-----------------------------------------------------------------

[^cassandra-3303-3.patch] should address all the concerns mentioned. 

I'm going to go ahead and pull some more of the logic out of StorageProxy and get rid of all the instanceof checks.
                
      was (Author: byronclark):
    [^casssandra-3303-3.patch] should address all the concerns mentioned. 

I'm going to go ahead and pull some more of the logic out of StorageProxy and get rid of all the instanceof checks.
                  
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141217#comment-13141217 ] 

Byron Clark commented on CASSANDRA-3303:
----------------------------------------

Yes, please. I'll be attaching the improved patch later today.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Clark updated CASSANDRA-3303:
-----------------------------------

    Attachment: cassandra-3303-4.patch

[^cassandra-3303-4.patch] removes all of the ugly logic to handle this case (and the short read case) into the ReadCommands.

Jonathan - Does this already address CASSANDRA-3395 or is more work needed for that one?
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.2
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, cassandra-3303-3.patch, cassandra-3303-4.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Clark updated CASSANDRA-3303:
-----------------------------------

    Attachment: cassandra-3303-2.patch

[^cassandra-3303-2.patch] doesn't reuse a counter variable on an inner loop.
                
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: cassandra-3303-1.patch, cassandra-3303-2.patch, long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3303) Short reads protection results in returning more columns than asked for

Posted by "Byron Clark (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Clark updated CASSANDRA-3303:
-----------------------------------

    Attachment: long_read.sh
    
> Short reads protection results in returning more columns than asked for
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3303
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Sylvain Lebresne
>            Assignee: Byron Clark
>            Priority: Minor
>             Fix For: 1.0.1
>
>         Attachments: long_read.sh
>
>
> When we detect a short read (in SP.fetchRows), we retry a new command created by:
> {noformat}
> logger.debug("detected short read: expected {} columns, but only resolved {} columns", sliceCommand.count, liveColumnsInRow);
> int retryCount = sliceCommand.count + sliceCommand.count - liveColumnsInRow;
> SliceFromReadCommand retryCommand = new SliceFromReadCommand(command.table,
>                                                              command.key,
>                                                              command.queryPath,
>                                                              sliceCommand.start,
>                                                              sliceCommand.finish,
>                                                              sliceCommand.reversed,
>                                                              retryCount);
> {noformat}
> That is, in that new command, the count is greater than what asked in the initial command. But we never cut back the result of that new retried query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira