Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-979

FileCacheStore should use fsync() when writing to disk

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 5.0.0.CR6, 5.0.0.FINAL
    • 4.2.1.CR1
    • Listeners
    • None

      This would be an optional flag, offering one of 3 modes (no sync, periodic sync - e.g., every second - and sync per write).

            [ISPN-979] FileCacheStore should use fsync() when writing to disk

            Manik Surtani (Inactive) added a comment - - edited

            Better to call it fsyncMode.

            fsyncMode = [default|perWrite|periodic]
            fsyncBufferSize = [number]
            fsyncInterval // defined in millis?
            

            Manik Surtani (Inactive) added a comment - - edited Better to call it fsyncMode . fsyncMode = [ default |perWrite|periodic] fsyncBufferSize = [number] fsyncInterval // defined in millis?

            Yeah, default sync is a much better name.

            Configuration wise, we'd add this:

            • sync or syncMode: 'defaultSync', 'syncPerWrite', 'periodicSync'
            • bufferSize: applicable for 'defaultSync' and 'periodicSync'
            • syncInterval: applicable for 'periodicSync' (hides an scheduled executor behind)

            Galder Zamarreño added a comment - Yeah, default sync is a much better name. Configuration wise, we'd add this: sync or syncMode: 'defaultSync', 'syncPerWrite', 'periodicSync' bufferSize: applicable for 'defaultSync' and 'periodicSync' syncInterval: applicable for 'periodicSync' (hides an scheduled executor behind)

            When you say no-sync, you mean you delegate to the BOS to do the flushing. So, not no-sync (that's misleading), but "default sync", maybe?

            Manik Surtani (Inactive) added a comment - When you say no-sync, you mean you delegate to the BOS to do the flushing. So, not no-sync (that's misleading), but "default sync", maybe?

            This could be one way of implementing it with minimal changes:

            • Sync per write: This is what we have today, open an FileOutputStream, write + flush whenever we update a bucket.
            • No sync: Wrap the FOS around a BufferedOutputStream and when the buffer gets filled it, let it do the flushing.
            • Periodic sync: Still wrap a FOS around a BOS, but then, apart from letting it flush when the buffer fills up, we have a way to flush it periodically, probably with some scheduled executor.

            Galder Zamarreño added a comment - This could be one way of implementing it with minimal changes: Sync per write: This is what we have today, open an FileOutputStream, write + flush whenever we update a bucket. No sync: Wrap the FOS around a BufferedOutputStream and when the buffer gets filled it, let it do the flushing. Periodic sync: Still wrap a FOS around a BOS, but then, apart from letting it flush when the buffer fills up, we have a way to flush it periodically, probably with some scheduled executor.

              rh-ee-galder Galder Zamarreño
              manik_jira Manik Surtani (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: