HK wrote:
Quote:
new to this database I wonder what happens if
I issue a kill -9 to a process that is currently writing
into the database with a put operation. Is there a
danger that the db is corrupt afterwards. How about
a power failure? |
Yes, that danger exists: a put can require updating multiple pages in
the database (e.g., B-tree page splits and hash table expansions). If
anything keeps all the changes from being recorded, you database will
be corrupt.
Quote:
Note that I am not asking for
transactions. I would just like to know if a put either
works or fails, or if it is possible that a kill -9 leaves the
db in the state of a half finished put? |
It can leave it in a half-finished state. If that's a problem, you'll
need transactions.
Quote:
A related question: How can I make sure that put-operations are not
cached in memory? |
Do you mean, how can you make sure that put-operations are flushed to
disk? That can be done using DB->sync()
Philip Guenther