You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Matthias Lehmann (JIRA)" <ji...@apache.org> on 2010/02/26 18:05:28 UTC

[jira] Created: (HBASE-2272) put with timestamp after delete is not stored

put with timestamp after delete is not stored
---------------------------------------------

                 Key: HBASE-2272
                 URL: https://issues.apache.org/jira/browse/HBASE-2272
             Project: Hadoop HBase
          Issue Type: Bug
    Affects Versions: 0.20.3
            Reporter: Matthias Lehmann


When I delete a row and afterwards put a value for that row again, I can not get it (so apparently it was not stored), but only, when I put the value with a timestamp.
A flush of the table between delete and put bypasses the problem.

I give a hbase-shell log as an example.
Lets assume, we have a table 'foo' with a column-familiy 's:':

The Error

>put 'foo', '123', 's:bar', 'hello'
>get 'foo', '123'
COLUMN                       CELL
 s:bar                       timestamp=..., value=hello
>deleteall 'foo', '123'
// put WITH timestamp
>put 'foo', '123', 's:bar', 'hello', 1267202287
> get 'foo', '123'
COLUMN                       CELL
// nothing, even though a value was saved before

But This Works

>put 'foo', '123', 's:bar', 'hello'
>get 'foo', '123'
COLUMN                       CELL
 s:bar                       timestamp=..., value=hello
>deleteall 'foo', '123'
// put WITHOUT timestamp
>put 'foo', '123', 's:bar', 'hello'
> get 'foo', '123'
COLUMN                       CELL
 s:bar                       timestamp=..., value=hello
// value was saved

And Also

>put 'foo', '123', 's:bar', 'hello'
>get 'foo', '123'
COLUMN                       CELL
 s:bar                       timestamp=..., value=hello
>deleteall 'foo', '123'
// flush table
>flush 'foo'
// put WITH timestamp
>put 'foo', '123', 's:bar', 'hello', 1267202287
> get 'foo', '123'
COLUMN                       CELL
 s:bar                       timestamp=..., value=hello
// value was saved

The error also occurs with single cells - one does not have to delete whole rows:

>put 'foo', '123', 's:bar', 'hello'
>put 'foo', '123', 's:baz', 'world'
>get 'foo', '123'
COLUMN                       CELL
 s:bar                       timestamp=..., value=hello
 s:baz                       timestamp=..., value=world
>delete 'foo', '123', 's:bar'
// put WITH timestamp
>put 'foo', '123', 's:bar', 'hello', 1267202287
>get 'foo', '123'
COLUMN                       CELL
 s:baz                       timestamp=..., value=world
// value for s:baz was not saved


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


[jira] Resolved: (HBASE-2272) put with timestamp after delete is not stored

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

Jean-Daniel Cryans resolved HBASE-2272.
---------------------------------------

    Resolution: Duplicate

Resolving as duplicate, please see HBASE-2256.

> put with timestamp after delete is not stored
> ---------------------------------------------
>
>                 Key: HBASE-2272
>                 URL: https://issues.apache.org/jira/browse/HBASE-2272
>             Project: Hadoop HBase
>          Issue Type: Bug
>    Affects Versions: 0.20.3
>            Reporter: Matthias Lehmann
>
> When I delete a row and afterwards put a value for that row again, I can not get it (so apparently it was not stored), but only, when I put the value with a timestamp.
> A flush of the table between delete and put bypasses the problem.
> I give a hbase-shell log as an example.
> Lets assume, we have a table 'foo' with a column-familiy 's:':
> The Error
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> > get 'foo', '123'
> COLUMN                       CELL
> // nothing, even though a value was saved before
> But This Works
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // put WITHOUT timestamp
> >put 'foo', '123', 's:bar', 'hello'
> > get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> // value was saved
> And Also
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // flush table
> >flush 'foo'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> > get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> // value was saved
> The error also occurs with single cells - one does not have to delete whole rows:
> >put 'foo', '123', 's:bar', 'hello'
> >put 'foo', '123', 's:baz', 'world'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
>  s:baz                       timestamp=..., value=world
> >delete 'foo', '123', 's:bar'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> >get 'foo', '123'
> COLUMN                       CELL
>  s:baz                       timestamp=..., value=world
> // value for s:baz was not saved

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


[jira] Commented: (HBASE-2272) put with timestamp after delete is not stored

Posted by "Matthias Lehmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839625#action_12839625 ] 

Matthias Lehmann commented on HBASE-2272:
-----------------------------------------

I made a terribly stupid mistake: I was used to think of timestamps of seconds since epoch time (python uses floats to express milliseconds) but HBase uses Longs of millisenconds since epoch time. So obviously, my explicit timestamps lay way back in the past, which is why the put with timestamp was shadowed by the delete.

Sorry that I took so much of you time - larsgeorge and jdcryans.


> put with timestamp after delete is not stored
> ---------------------------------------------
>
>                 Key: HBASE-2272
>                 URL: https://issues.apache.org/jira/browse/HBASE-2272
>             Project: Hadoop HBase
>          Issue Type: Bug
>    Affects Versions: 0.20.3
>            Reporter: Matthias Lehmann
>
> When I delete a row and afterwards put a value for that row again, I can not get it (so apparently it was not stored), but only, when I put the value with a timestamp.
> A flush of the table between delete and put bypasses the problem.
> I give a hbase-shell log as an example.
> Lets assume, we have a table 'foo' with a column-familiy 's:':
> The Error
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> > get 'foo', '123'
> COLUMN                       CELL
> // nothing, even though a value was saved before
> But This Works
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // put WITHOUT timestamp
> >put 'foo', '123', 's:bar', 'hello'
> > get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> // value was saved
> And Also
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // flush table
> >flush 'foo'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> > get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> // value was saved
> The error also occurs with single cells - one does not have to delete whole rows:
> >put 'foo', '123', 's:bar', 'hello'
> >put 'foo', '123', 's:baz', 'world'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
>  s:baz                       timestamp=..., value=world
> >delete 'foo', '123', 's:bar'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> >get 'foo', '123'
> COLUMN                       CELL
>  s:baz                       timestamp=..., value=world
> // value for s:baz was not saved

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


[jira] Commented: (HBASE-2272) put with timestamp after delete is not stored

Posted by "Jean-Daniel Cryans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838966#action_12838966 ] 

Jean-Daniel Cryans commented on HBASE-2272:
-------------------------------------------

Looking further into it, the shell output pasted doesn't show the ts for the first put so my guess is that the second put's ts is lower than the delete's ts. This code does basically the thing:

{code}
  public void testCloseMs() throws Exception {
    byte [] qualifier = Bytes.toBytes("qf1");
    Put put = new Put(row1);
    put.add(CONTENTS_FAMILY, qualifier, value);
    table.put(put);
    Get get = new Get(row1);
    table.get(get); // just to spend some time
  
    Delete del = new Delete(row1);
    table.delete(del);
    get = new Get(row1);
    res = table.get(get);
    assertEquals(0, res.raw().length);
  
    Thread.sleep(100);
    put = new Put(row1);
    put.add(CONTENTS_FAMILY, qualifier, System.currentTimeMillis(), value);
    table.put(put);
    get = new Get(row1);
    res = table.get(get);
    assertEquals(1, res.raw().length);
  }
{code}

Add it to TestPut (in branch) to make it work. It passes.

> put with timestamp after delete is not stored
> ---------------------------------------------
>
>                 Key: HBASE-2272
>                 URL: https://issues.apache.org/jira/browse/HBASE-2272
>             Project: Hadoop HBase
>          Issue Type: Bug
>    Affects Versions: 0.20.3
>            Reporter: Matthias Lehmann
>
> When I delete a row and afterwards put a value for that row again, I can not get it (so apparently it was not stored), but only, when I put the value with a timestamp.
> A flush of the table between delete and put bypasses the problem.
> I give a hbase-shell log as an example.
> Lets assume, we have a table 'foo' with a column-familiy 's:':
> The Error
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> > get 'foo', '123'
> COLUMN                       CELL
> // nothing, even though a value was saved before
> But This Works
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // put WITHOUT timestamp
> >put 'foo', '123', 's:bar', 'hello'
> > get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> // value was saved
> And Also
> >put 'foo', '123', 's:bar', 'hello'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> >deleteall 'foo', '123'
> // flush table
> >flush 'foo'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> > get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
> // value was saved
> The error also occurs with single cells - one does not have to delete whole rows:
> >put 'foo', '123', 's:bar', 'hello'
> >put 'foo', '123', 's:baz', 'world'
> >get 'foo', '123'
> COLUMN                       CELL
>  s:bar                       timestamp=..., value=hello
>  s:baz                       timestamp=..., value=world
> >delete 'foo', '123', 's:bar'
> // put WITH timestamp
> >put 'foo', '123', 's:bar', 'hello', 1267202287
> >get 'foo', '123'
> COLUMN                       CELL
>  s:baz                       timestamp=..., value=world
> // value for s:baz was not saved

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