5.7 Status Codes

loregd returns seven of the RSI status codes:

StatusValueReturned when
RSI_OK0The operation succeeded. Also returned by the idempotent deletions when their target was already absent.
RSI_NOT_FOUND1A named key GUID exists in neither store, or resolves to no registered hive. Also an update matching no row.
RSI_ALREADY_EXISTS2A duplicate key GUID or path entry: the target table's primary key, or the matching check against the other store (§5.3, §5.4). No value operation produces it — every value write is an INSERT OR REPLACE.
RSI_STORAGE_ERROR3A SQLite failure while serving the request. Also an operation whose GUID belongs to a hive other than the one its transaction is bound to, a mutating operation carrying an unknown transaction id, and a failed commit that was not busy.
RSI_TXN_BUSY6BEGIN IMMEDIATE found the database busy, a conditional write could not begin its transaction, or RSI_FLUSH or RSI_DELETE_LAYER found a transaction already bound to a hive's write connection.
RSI_INVALID7An unknown opcode, a request whose payload cannot be decoded, an out-of-range RSI_WRITE_KEY field mask, a mutating operation carrying a read-only transaction id, an RSI_FLUSH naming an unregistered hive, or an RSI_BEGIN_TRANSACTION re-using an active id or naming a mode other than RSI_TXN_READ_WRITE or RSI_TXN_READ_ONLY.
RSI_CAS_FAILED8A conditional RSI_SET_VALUE whose target was absent or whose sequence did not match.

Three codes are defined by the interface and never produced by loregd: RSI_NOT_EMPTY (4), RSI_TOO_LARGE (5), and RSI_TXN_NOT_SUPPORTED (9).

RSI_TXN_NOT_SUPPORTED is never needed because loregd supports both transaction modes (§4.3).

RSI_TOO_LARGE is never returned because an oversized or malformed frame is not answered at all. Framing is validated before an opcode is known, and a frame that fails validation ends the connection instead of producing a response (§2.3).

Edit this page