It all depends on how comfortable you
are with loosing some of the log messages in the event of a server
crash or syslog daemon crash.
One of my primary roles is logging with regards to security and auditing, so I am not comfortable with loosing ANY messages. For me, if you are not copying log messages to one or more central servers and are only storing log messages to local log files I would recommend that you do NOT remove the sync option for syslog. On the other hand we run some databases that contain only public information that is transient in nature. Security and auditing are not a concern in these environments so we could tolerate some message loss if the server were to crash. The likelihood is low and the loss of some log lines is not a significant concern. In my opinion disabling the sync feature in this environment would be acceptable. You also need to consider that log messages are produced after a program completes an action, so there is always a small window where the action is completed but the log message is not yet produced by the application. If the server crashes at that point you have effectively lost one log message regardless of the sync setting of your logging infrastructure. There is no right or wrong answer. It is a judgement call that you will have to make for your use case. If any PostgreSQL developers have read this far, perhaps you can add details on where in the transaction process the log messages are produced. Are the log messages produced immediately prior to the commit acknowledgement or after the commit? I think the race condition exists either way. Either the logs indicate that the action was committed when it was not, or the commit is completed but the log message was not produced. I hope I haven't made things more confusing for you. Evan. On 08/06/2017 05:29 PM, Don Seiler wrote:
|