Re:Logging can be tricky
by sargun on Tuesday September 23, 2014 @06:58PM
(#8358852)
Why would you fsync logs for a high-level service? Are you afraid a power outage is going to cause you to lose service logs?
[ Parent
| on HN ]
Re:Logging can be tricky
by TheLoneWolfling on Tuesday September 23, 2014 @09:15PM
(#8359407)
Making sure your logging data gets written is relatively important.
Say, if you hit a bug somewhere that causes the server itself to crash.
Re:Logging can be tricky
by frankzinger on Wednesday September 24, 2014 @04:46AM
(#8360432)
How about installing a SIGSEGV, etc. handler to do the fsync (and perhaps even print a stacktrace)?
Disabling buffering in the file library should provide for a similar mitigation outlook. If the OS accepts the writes it WILL make it to disk unless the some part of the storage sub system(or the os itself) fails. So if the process dies recent writes should make it to disk regardless. But if the process triggers a complete system crash then you're kinda stuck needing fsync's :|
Re:Logging can be tricky
by frankzinger on Thursday September 25, 2014 @02:39AM
(#8365916)
> Disabling buffering in the file library should provide for a similar mitigation outlook
Did you mean logging library? I.e., application-level buffering? In that case, good point.
Re:Logging can be tricky
by evan_miller on Wednesday September 24, 2014 @11:49AM
(#8362117)
The fsync() is implicit behavior of the glog framework for Go. We didn't actually want it.