Quoting Karl Hakimian <[EMAIL PROTECTED]>:

On Fri, Feb 10, 2006 at 07:42:45PM +0100, Magnus Hagander wrote:
> Yes, it would be possible to commit the filename/path inserts
> immediately (i.e. 1 insert per transaction) but still do the
> file inserts within a larger transaction.

Not really, if you want/need to refer to them from transaction 1. If you
add them in transaction2, transaciton 1 will *never* see those rows.
It'll hav eto commit and open transactio 3 before they become visible.

This would still work if you opened a transaction for committing the
names after you finished updating paths and filenames (I'm thinking of
the case where the attributes are spooled) in a case like this, your
large number of adds to the file table will not need anything that gets
added to the path or filename table after you start.

It all depends on selected transaction isolation level (SQL standards define four of them). PostgreSQL implements read commited level (drity read is not possible, however non-repeatable read and phantom reads are possible) and serializable level (dirty, non-repeatable and phantom reads are not possible).

For proposed change to work, I guess we would need to utilize serializable transaction isolation (the most strict level). However in this mode, transaction might fail if any other transaction changed rows that would result in incosisten view for the current transaction, and Bacula would need additional code to deal with it (make appropriate adjustments to transaction and re-attempt it).

For more info and much better description of isolation levels:
http://www.postgresql.org/docs/8.1/interactive/transaction-iso.html


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to