Refresh & flush

Hy,

Is the answer to this post Relationship between refresh & flush still valid ?

id "Yes that is expected, a refresh calls a flush and writes files to the filesystem"

in general yes, but the wording is a bit tricky.

A refresh writes data to disk (so it is searchable), but it does not guarantee durability - which means these writes may be lost on a sudden power outage, which is not a problem because it can be recreated without problems due to the existence of a write ahead log (WAL). However it is much more expensive to write data to disk and get the feedback from the operating system that it has been persisted and will survive restarts. Because this system call is so expensive, you try to avoid to call once per second. This is the reason why there is a refresh, which is lightweight, but not durable and a flush which durable but more heavyweight. A flush is executed periodically in the background.

hope this helps.

Thanks for the explanation, what i understood is that a refresh writes but data may still be in some disk cache without beeing written on physical device and a flush forces the write on physical device.

Is it something like that ?

yes, that is the high level overview.

Thanks for your answer Alexander.