You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Vijay (JIRA)" <ji...@apache.org> on 2010/01/15 05:36:55 UTC

[jira] Created: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

Insert, Delete and Insert into a column family doesnt work... 
--------------------------------------------------------------

                 Key: CASSANDRA-703
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 0.5, 0.9
         Environment: Linux, Cassandra .5
            Reporter: Vijay
            Priority: Minor


Here is the code to reproduce the issue...

        ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
        con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);

        ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
        con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);

        con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);

        ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
        assertEquals(col.getSuper_column().getColumns() != null, true);

Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Jonathan Ellis commented on CASSANDRA-703:
------------------------------------------

just to rule out the obvious, did you test using timestamps 0, 1, 2 instead of System.currentTimeMillis()?  if the remove takes less than 1ms, the following insert will have the same timestamp and the remove will take precedence (ties go to tombstone).

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Vijay commented on CASSANDRA-703:
---------------------------------

+1, tested and works... thanks Jonathan..

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: 703-05.txt, 703-trunk.txt, bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Vijay updated CASSANDRA-703:
----------------------------

    Attachment: bug-fix-703.txt

Suggesting this changes....  This might need the users to flush the data to disk.... and then use it.... is this incompatable because the seralizer, deserializer is changed... we might need to add one more field timestamp.... not sure if it is the right way to do it.

1) Added the timestamp to the constructor for the supercolumn.
2) Added the timestamp to serializer deserializer
3) change the classes dependent on it to fix the initialization
4) When new col is added the recent chang timestamp is updated.

Thanks
Vijay

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.5, 0.9
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>         Attachments: bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Jonathan Ellis updated CASSANDRA-703:
-------------------------------------

    Attachment: 703-trunk.txt

the internals are fine; the bug is in turning the data from the internal representation into Thrift objects.  patch attached.

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: 703-trunk.txt, bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Jonathan Ellis updated CASSANDRA-703:
-------------------------------------

    Attachment: 703-05.txt

0.5 version of patch

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: 703-05.txt, 703-trunk.txt, bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Vijay commented on CASSANDRA-703:
---------------------------------

Hi Jonathan, yes actually i did the following...

first insert
System.currentTimeMillis() 

first delete
System.currentTimeMillis()  + 5

secound insert
System.currentTimeMillis()  + 10

        String supcol = "12356";
        Client con = ConnectionCacheUtils.getinstance().getCassandraConnection().getclient();
        ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column(supcol.getBytes()).setColumn("1234".getBytes());
        con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
        
        ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column(supcol.getBytes());
        ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
        assertEquals(col.getSuper_column().getColumns() != null, true);
        
        con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis() + 5, 2);
        con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis() + 10, 2);
        
        ColumnOrSuperColumn col2 = con.get("WBXCDOCUMENT", "vijay", path, 2);
        assertEquals(col2.getSuper_column().getColumns() != null, true);

Regards
Vijay

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Jonathan Ellis updated CASSANDRA-703:
-------------------------------------

        Fix Version/s: 0.5
    Affects Version/s:     (was: 0.6)
                           (was: 0.5)

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Jonathan Ellis commented on CASSANDRA-703:
------------------------------------------

I can reproduce with this system test:

    def test_vijay(self):
        key = 'vijay'
        client.insert('Keyspace1', key, ColumnPath('Super1', 'sc1', _i64(4)), 'value4', 0, ConsistencyLevel.ONE)

        client.remove('Keyspace1', key, ColumnPath('Super1', 'sc1'), 1, ConsistencyLevel.ONE)

        client.insert('Keyspace1', key, ColumnPath('Super1', 'sc1', _i64(4)), 'value4', 2, ConsistencyLevel.ONE)

        result = client.get('Keyspace1', key, ColumnPath('Super1', 'sc1'), ConsistencyLevel.ONE)
        assert result.super_column.columns is not None, result.super_column


> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: bug-fix-703.txt
>
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CASSANDRA-703) Insert, Delete and Insert into a column family doesnt work...

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

Vijay reassigned CASSANDRA-703:
-------------------------------

    Assignee: Vijay

> Insert, Delete and Insert into a column family doesnt work... 
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-703
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-703
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.5, 0.9
>         Environment: Linux, Cassandra .5
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>
> Here is the code to reproduce the issue...
>         ColumnPath colpath = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes()).setColumn("1234".getBytes());
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnPath path = new ColumnPath().setColumn_family("VERSIONS").setSuper_column("123".getBytes());
>         con.remove("WBXCDOCUMENT", "vijay", path, System.currentTimeMillis(), 2);
>         con.insert("WBXCDOCUMENT", "vijay", colpath, "test".getBytes(), System.currentTimeMillis(), 2);
>         ColumnOrSuperColumn col = con.get("WBXCDOCUMENT", "vijay", path, 2);
>         assertEquals(col.getSuper_column().getColumns() != null, true);
> Expected result, get the column family..... but it throws notfound exception which is wrong.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.