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.
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,UNDROPorMOVEruns as a read:BACKUPandRESTOREreturn a row. A repeat within the cache TTL (10 s to 1 h) is answered from the cache, and the statement does not run again. It is the same failure as bug(pipes): mutation pipe results are cached and coalesced — the write silently drops on repeat calls #386.UNDROPandMOVEreturn no result set. On the read path, a statement that returns no result set fails with an error after it has run. The SDK may then retry it (see fix(pipes): run write pipes every call, uncached and uncoalesced #634).isMutationalso drivesexecuteCHQuery's choice betweenExecandQuery. So addingBACKUP/RESTOREto the list is not enough on its own: their result row would be lost, becauseExecdrops it.Options:
Exec/Querydispatch.Until then,
pipes.mdxsays not to put a write led by another verb in a pipe.