package granary

  1. Overview
  2. Docs
Pure-OCaml SQL engine

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.0.3.tar.gz
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11

doc/granary.storage/Granary_storage/Pager_event/index.html

Module Granary_storage.Pager_eventSource

Sourcetype t =
  1. | Page_read of {
    1. page_id : int64;
    }
    (*

    main-file backend read — pager cache MISS only; WAL-served reads emit Wal_read instead

    *)
  2. | Wal_read of {
    1. page_id : int64;
    }
    (*

    WAL-overlay backend read (#392) — pager cache MISS resolved from a WAL frame rather than the main file

    *)
  3. | Page_write of {
    1. page_id : int64;
    }
    (*

    page written to WAL/main on flush

    *)
  4. | Page_alloc of {
    1. page_id : int64;
    2. reused : bool;
      (*

      true = freelist/txn-pool reuse; false = file extend

      *)
    }
  5. | Page_free of {
    1. page_id : int64;
    }
    (*

    page pushed to the freelist / txn pool

    *)

Page-level signal emitted by Granary_storage.Pager for the internals monitor (#384). Storage-local on purpose: Store_event lives a layer up in granary.store, which depends on this library, so the pager cannot reference it without creating a dependency cycle. Store.set_event_callback translates these into Store_event.t variants.

Emitted on a pager-level backend resolution (the pager's own page cache missed): Page_read fires when the page is served from the MAIN FILE, Wal_read (#392) when it is served from the WAL overlay. Neither fires on a pager cache hit. Like Page_read, Wal_read fires per pager-level resolution regardless of any cache internal to the WAL layer (its frame cache), mirroring how Page_read fires regardless of the OS/block-device cache under read_page. Page_write fires once per dirty page handed to the WAL/main on flush.

Sourceval pp : Format.formatter -> t -> unit

Pretty-print a page event (e.g. PAGE_ALLOC page=9 reused=true).