User: Password:
|
|
Subscribe / Log in / New account

sync() starves other reader/writers

sync() starves other reader/writers

Posted Mar 27, 2014 18:06 UTC (Thu) by dlang (subscriber, #313)
In reply to: sync() starves other reader/writers by seanyoung
Parent article: PostgreSQL pain points

Plus you want to make sure none of the database files get written ahead of the corresponding WAL data


(Log in to post comments)

sync() starves other reader/writers

Posted Mar 27, 2014 19:44 UTC (Thu) by seanyoung (subscriber, #28711) [Link]

Indeed, there are two solutions to this:

1) write the journal before you do anything (requires repeating the operations twice)
2) Before modifying a database page, ensure that any scheduled i/o has completed. If not either copy the page or move on to other pending work.

So ideally you want completion information on page level for non-fsync writes.

sync() starves other reader/writers

Posted Mar 27, 2014 20:05 UTC (Thu) by dlang (subscriber, #313) [Link]

given that your transaction is likely to affect multiple database pages, #2 isn't viable, you can never guarantee that all or none of the transaction will be visible after a crash. That's why the databases do #1


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds