Skip to content

MULTI/EXEC compatibility: first runtime error aborts the whole transaction (Redis executes remaining commands) #502

Description

@liunyl

Summary

In Redis, runtime errors inside EXEC do not abort the transaction: every queued command executes and errors are reported per-command in the reply array (only queue-time errors abort). EloqKV's MultiExec aborts the entire engine transaction on the first runtime error.

Details

src/redis_service.cpp:2055 (RedisServiceImpl::MultiExec) — on a failed command the txn is aborted (:2345, "Error occurs in MultiExec, abort txn") and the client receives an aborted-EXEC result rather than an array containing the per-command error.

EloqKV's behavior is arguably better (real atomicity with rollback is the product's selling point), but it silently diverges from documented Redis semantics, which some clients/test suites rely on (e.g. wrong-type errors mid-transaction).

Suggested resolution

Decide and document the intended semantics:

  • keep abort-on-error as an EloqKV feature → document prominently in compatibility docs (and docs/02-command-processing.md already records the divergence), or
  • match Redis by executing remaining commands and embedding per-command errors, with rollback reserved for explicit BEGIN/ROLLBACK sessions.

Found during the module-docs review (#492); see docs/02-command-processing.md.

🤖 Found with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions