Skip to content

Large workflow completions exhaust MySQL sort memory during principal attribution #133

Description

@rmcdaniel

Confirmed failure

A native MySQL 8.0.46 experiment using Server 2.2.1 dependencies and the storage-admission candidate rejected eight already-leased workflow completions with HTTP 500. Each result was an 896 KiB string. MySQL reported error 1038 (Out of sort memory), not storage exhaustion. No container was OOM-killed.

WorkerTerminalEventAttribution::record() selects the entire terminal history row while ordering by sequence. The large JSON payload is needlessly carried through MySQL filesort before its audit principal is added. The query runs inside the completion transaction, so the completion does not commit.

Fix and acceptance

  • Select the terminal event identity using the existing run/task/event-type filters and sequence ordering, then fetch that event without sorting its payload.
  • Preserve authenticated principal attribution and completion transaction semantics.
  • Add focused regression coverage and rerun the native concurrent large-result case with the unchanged default sort buffer, storage limit and drain threshold.
  • Publish the fix through normal Server release checks.

Found while qualifying #131; implementation and native proof will be included in #132. No production admission configuration has changed.

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