Skip to content

bug(pipes): a BACKUP/RESTORE/UNDROP pipe runs as a read and is cached #666

Description

@EricAndrechek

Area: pipes

With #634 (in review), a pipe whose SQL is a write runs on every call: it is neither cached nor coalesced (#386). A statement counts as a write when it is led by one of the verbs in mutationVerbs (internal/api/clickhouse_exec.go). Any other statement runs as a read, which means it is cached and coalesced.

That leaves out several statements that change state. A pipe led by BACKUP, RESTORE, UNDROP or MOVE runs as a read:

isMutation also drives executeCHQuery's choice between Exec and Query. So adding BACKUP/RESTORE to the list is not enough on its own: their result row would be lost, because Exec drops it.

Options:

  • Give the pipe handler a separate "never cache" verb set that is independent of the Exec/Query dispatch.
  • Or refuse these verbs in a pipe definition at load time.

Until then, pipes.mdx says not to put a write led by another verb in a pipe.

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

    area/pipesNamed query pipesbugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions