journal-fence
Services such as FIX Drop Copy, Fix Store Gateway, Data Warehouse, and async journal replication tail the Ember journal and persist progress in a fence file (sequence number and journal partition). Fence files live under $EMBER_WORK/journal/.
The bin/journal-fence tool inspects or updates these fences. A typical use during interim failover is to mark a stopped Drop Copy service as fully caught up so that, on restart, it skips historical backlog and only forwards new journal messages.
If you are using Docker, the tool is available as /opt/deltix/ember/bin/journal-fence. You may need to redefine Ember entrypoint to shell.
Prerequisites
- Define
EMBER_WORK(or run inside an Ember Docker image where it is already set). The tool locates the journal at$EMBER_WORK/journaland the fence at$EMBER_WORK/journal/<fence-name>. - Stop the service that owns the fence (for example Drop Copy) before
--syncor--write. Fence files are memory-mapped and are not locked exclusively.
Fence name
The <fence-name> argument is the fence file name in the $EMBER_WORK/journal/ directory:
| Service | Fence name |
|---|---|
| Drop Copy | fence-drop-copy |
| FIX Store Gateway | fence-fix-store-gw |
| Data warehouse (per configured unit) | fence-warehouse-<name> (e.g. fence-warehouse-timebase) |
| Async replication | replication (no fence- prefix) |
Usage
journal-fence <fence-name> [--read]
journal-fence <fence-name> --sync
journal-fence <fence-name> --write <sequence>
| Argument | Description |
|---|---|
fence-name | Fence file name under $EMBER_WORK/journal (see Fence name) |
--read | Print current fence and journal end-of-stream sequence/partition (default if no mode is given) |
--sync | Set the fence to the latest journal sequence and the matching partition |
--write N | Set the fence to sequence N and the journal partition where N lives |
Examples:
# Inspect Drop Copy fence vs journal
bin/journal-fence fence-drop-copy --read
# Mark Drop Copy as fully caught up (failover)
bin/journal-fence fence-drop-copy --sync
# Move fence to a specific Ember sequence
bin/journal-fence fence-drop-copy --write 1234567
Sample --read output:
Fence: /var/lib/emberwork/journal/fence-drop-copy
sequence: 1000
partition: 2
Journal: /var/lib/emberwork/journal
sequence: 1500
partition: 3
Sample --sync output:
Updated fence /var/lib/emberwork/journal/fence-drop-copy
sequence: 1000 -> 1500
partition: 2 -> 3
Notes
- Ember message sequence numbers are global across the journal (not per partition).
--syncand--writealways update both sequence and partition so compaction watermarks stay consistent. --writefails if the requested sequence is above the current end of the journal.- This tool does not modify FIX session message stores. It only moves the journal cursor used by the fence owner.