RANGE SERVER supplied timestamp is not strictly increasing

1 view
Skip to first unread message

swin

unread,
Apr 14, 2008, 6:08:05 AM4/14/08
to Hypertable User
hi:

When I insert a record with the same row key but with older
timestamp,it throw error "RANGE SERVER supplied timestamp is not
strictly increasing" , but in my application I need to do so, how can
I avoid this error.

Thanks.

Doug Judd

unread,
Apr 14, 2008, 3:15:40 PM4/14/08
to hyperta...@googlegroups.com
Hi Wang,

Most applications should *not* supply timestamps.  The timestamps are used internally by Hypertable to coordinate compactions, recovery, and concurrency.  Any problems (such as delays, etc.) in the incoming stream of supplied timestamps can wreak havoc on the system.  So, in general, applications should let the system auto-assign timestamps.  Unfortunately, the original apache_log example supplied timestamps , which was misleading, since this practice should be avoided.

So how do you do time range queries?  Take a look at the most recent Apache Log example under the examples/apache_log directory.  The way you set up a table for timestamp range queries is by embedding the timestamp into the row key.  The apache_log_load.cc program takes an option which will cause the row key to be generated in one of two ways:

<page> <timestamp>

or

<timestamp> <page>

The following shows a snippet of SELECT output for the above two row key formats.

/index.html 2008-01-26 00:21:27 ClientIpAddress 81.52.143.15
/index.html 2008-01-26 07:57:15 ClientIpAddress 218.111.214.141
/index.html 2008-01-26 08:29:33 ClientIpAddress 69.208.248.144

or alternatively ...

2008-01-26 00:21:27 /index.html ClientIpAddress 81.52.143.15
2008-01-26 07:57:15 /index.html ClientIpAddress 218.111.214.141
2008-01-26 08:29:33 /index.html ClientIpAddress 69.208.248.144

So, for example, with the last format, to return all rows from January 2008, you would issue the following SELECT query:

SELECT * from MyTable where ROW STARTS WITH "2008-01";

- Doug

2008/4/14 swin <wang...@gmail.com>:

Doug Judd

unread,
Apr 14, 2008, 3:38:58 PM4/14/08
to hyperta...@googlegroups.com
BTW, to get the latest apache_log example code, you need to pull the latest code from the git repository.  The following page describes how to do this:

http://code.google.com/p/hypertable/wiki/SourceCode?tm=4

- Doug

2008/4/14 Doug Judd <do...@zvents.com>:
Reply all
Reply to author
Forward
0 new messages