[Xapian-tickets] [Xapian] #333: Keep track of last modification time of database

Xapian nobody at xapian.org
Fri Apr 17 00:37:23 BST 2015


#333: Keep track of last modification time of database
---------------------------+------------------------------
 Reporter:  richard        |             Owner:  olly
     Type:  enhancement    |            Status:  new
 Priority:  normal         |         Milestone:  1.4.x
Component:  Backend-Chert  |           Version:  SVN trunk
 Severity:  normal         |        Resolution:
 Keywords:                 |        Blocked By:
 Blocking:                 |  Operating System:  All
---------------------------+------------------------------
Changes (by olly):

 * milestone:  1.3.x => 1.4.x


Comment:

 Reviewing this, I'm still leaning towards file timestamps as the best
 approach overall.  If the limitations prove to be a problem, we could
 always switch to storing an explicit timestamp later.

 I think this probably should work on a Database object (rather than just
 being some static method taking a path).

 I'm not entirely sure what the returned type should be.  The obvious
 choices are `time_t` (1 second resolution), `struct timeval` (1 µs
 resolution), `struct timespec` (1 ns resolution) or `double` (which should
 be able to hold any 64-bit integer value exactly, but seems a little
 problematic).  POSIX and C11 specify `struct timespec`, which makes it a
 promising option.  It would mean pulling in an external system header
 though.

 Getting the timestamp:

  * For chert, we can look at the base file we used to open the record
 table.
  * For glass, we can just use the timestamp of the version file.
  * For inmemory, we'd probably just return ''unknown''.
  * For remote, this would need a protocol tweak (but could return
 ''unknown'' for now).
  * For multidatabases, we'd return max() for the subdatabases (or
 ''unknown'' if any are unknown).
  * For writable databases, I'm not really sure what's best.  The options I
 can see are:
    * Define that's this is the last time a commit happened.
    * Update a timestamp on each modification (which is an extra overhead
 to maintain data we will probably never use for a case where the timestamp
 probably isn't very important anyway).
    * Return ''unknown''.
    * Return the current time.

 I don't see this as a blocker for 1.4.0, as it doesn't need incompatible
 changes, and nobody's asked about it since the initial request.

--
Ticket URL: <http://trac.xapian.org/ticket/333#comment:6>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list