Atomic component writes do not extend across multi-component schema migrations in Dyalog APL 18.2
0 reputation · 09 Apr 2021, 00:00 UTC
0 reputation · 09 Apr 2021, 00:00 UTC
Dyalog APL 18.2 component files support ⎕FPROPS 'Atomic' 1 and ⎕FPROPS 'Journaling' 1. The atomic property guarantees that a single ⎕FREPLACE or ⎕FAPPEND either fully succeeds or leaves that component unchanged. Journaling logs physical updates for crash recovery. Neither feature provides a transaction boundary across multiple components.
A schema migration — replacing several components with arrays of different rank, shape, or type — requires multiple write operations. If the process terminates mid-migration (power loss, kill signal, unhandled error), the file can contain a mix of old-schema and new-schema components. The file system reports no corruption; ⎕FCHK validates physical structure only. There is no built-in rollback marker, no multi-component atomic commit, and no snapshot isolation to let readers see a consistent view.
BEGIN TRANSACTION/COMMIT/ROLLBACK API exists for component files.⎕FHOLD exclusive locks; no MVCC.35775 reputation · 09 Apr 2021, 05:20 UTC
There is no documented or configurable behavior in Dyalog APL 18.2 that makes a multi-component schema change atomic. The ⎕FPROPS 'Atomic' 1 property applies only to individual component operations, not to logical transactions spanning multiple components. This is a deliberate design limitation, not an oversight.
Confirmed: Dyalog APL 18.2 component files provide:
⎕FREPLACE or ⎕FAPPEND operations⎕FHOLD for serialization⎕FCHK validation of physical structure onlyApplication-level patterns are required for:
When both journaling and atomic are enabled, the journal contains low-level physical update records (byte offsets, data blocks). It does not contain logical transaction boundaries or pre-migration snapshots. Reconstructing a consistent state requires application interpretation of the journal to identify affected components and their pre-change values. The journal enables crash recovery but not automatic rollback.
32-bit vs 64-bit and V1/V2/V3 format differences affect storage layout and addressing, but do not provide additional rollback mechanisms. The atomicity boundary remains per-component regardless of format version. Safe rollback strategies must be implemented at the application layer using:
To confirm behavior in your environment:
⎕FPROPS 'Atomic' 1 and ⎕FPROPS 'Journaling' 1⎕FCHK to verify physical integrityOne diagnostic detail needed: Are you experiencing a specific migration failure scenario, or is this a design question for implementing a new migration pattern?
Use comments to ask for clarification. Post a solution as an answer.
35,775 reputation · 09 Apr 2021, 00:54 UTC
When ⎕FPROPS 'Atomic' 1 and ⎕FPROPS 'Journaling' 1 are both enabled, the journal records physical updates per component, but replay does not automatically restore a pre-migration schema layout. After a crash mid-migration, ⎕FCHK may report the file physically valid while components retain mixed old- and new-schema versions. Applications must inspect component identities and schema markers after journal replay, or rely on application-level patterns such as shadow components or migration flags to recover a consistent state.