This message was deleted.
# general
s
This message was deleted.
y
With no fsync, the journal entries are written in the OS page cache but not flushed to disk. In case of power failure, the affected bookie might lose the unflushed data. You let OS control when to flush page cache. You may need to check your OS kernel settings.
g
If it is controlled at OS level, then how does the metric
bookie_journal_JOURNAL_SYNC_count
figure the value out?
That metric is emitted by bookies
y
The total number of journal fsync operations happening at the bookie. The
success
label is used to distinguish between successes and failures.
g
yes, but if its kernel triggered, how does bookkeeper process figure it out?
y
fsync is a system call. if journal sync is disabled (os pagecache on), sync system call should be used.
bookie also uses syscall (fsync).
fsync can be called from user space.
g
so, does it mean that irrespective of the fsync happening by kernel itself due to page cache dirty write sysctl values, bookies also trigger fsync system call every second?
y
I am not sure your question.
my understanding is, journalsync on -> fsync, journalsync off -> sync (os memory pressure to sync dirty cache).
g
the mtric value of journal_sync_count is always 1/sec - irrespective of the throughput each bookie is observing. I am assuming if bookies write to page cache and fsync is handled by kernel, it should vary based on throughput.. i.e. can't be constant.. thus, i was wondering what that 1/sec represent.
i also found this - https://github.com/apache/bookkeeper/commit/8201de86a6e04164efa4fabbf91d4c4a67bbd1fe in 4.16 they added a flag to control this. we are on pulsar 2.9.3 , so bookie 4.14 ..
y
👍
g
It's still unclear what the 1/second represent though 🙂
y
according to the issue, I think there is no more sync syscall. You either use journalsyncdata=true (fsync journal log before ack) or journalsyncdata=false (fsync every 1 second).
g
Yea, I was checking the system defaults. the default sync interval is 30 seconds, or some memory dirty ratio (which we don't breach). I checked the ForceWriteThread logic, which does the fsync, but couldn't find how its limiting to 1 second rate.. https://github.com/apache/bookkeeper/blob/branch-4.14/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java#L495
a
@Hang Chen I wonder if you can validate this? Very interesting thread.
h
You can use
journalPageCacheFlushIntervalMSec
to control the OS PageCache flush interval when disabled the fsync
i also found this - https://github.com/apache/bookkeeper/commit/8201de86a6e04164efa4fabbf91d4c4a67bbd1fe
in 4.16 they added a flag to control this. we are on pulsar 2.9.3 , so bookie 4.14 ..
This PR has been released since 4.11, so it is available in 4.14
🙏 1