[Xapian-tickets] [Xapian] #333: Keep track of last modification time of database
Xapian
nobody at xapian.org
Tue Feb 17 17:28:55 GMT 2009
#333: Keep track of last modification time of database
---------------------------+------------------------------------------------
Reporter: richard | Owner: olly
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Backend-Chert | Version: SVN trunk
Severity: normal | Blockedby:
Platform: All | Blocking:
---------------------------+------------------------------------------------
It would be useful to be able to find out the time at which a modification
was last made to a database. Two possible uses for this information:
- supporting caching in an HTTP search server: for example, this would
allow if-modified-since requests to be satisfied without having to perform
a search (when not modified since).
- displaying status information about a database to users.
To implement this, we'd need to store the modification time in the
database somewhere, since we want to know the time of the last successful
commit; this can't be derived by looking at the timestamp of the files,
since it's possible that a commit nearly happened, but was cancelled or
failed at the last minute (or, indeed, since we use fdatasync(), that a
commit succeeded, but the timestamp information about the file
modification never got written to disk due to a machine crash immediately
after the commit).
This could be emulated by storing the current time in a metadata value
each time that flush() is called, but this wouldn't cover modifications
made by implicit flushes. Currently, to implement this correctly on top
of xapian, you'd need to use explicit transactions.
--
Ticket URL: <http://trac.xapian.org/ticket/333>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list