#3085·typesense

Feature request: cancel an in-progress schema alter (alter is replayed from zero on restart and blocks writes for hours)

Author: thebossza101Created Sep 30, 2026Updated Sep 30, 2026

Summary

There is no way to cancel an in-progress schema alter (PATCH /collections/:name). On a large collection an alter can run for many hours, and while it runs writes are blocked. Restarting the node does not help: the alter is replayed from the Raft log and starts again from zero. The only escape we found is restarting with --skip-writes, which also discards every other write that is not yet in a snapshot.

We would like a supported way to cancel (or at least inspect) a running schema change.

Environment

  • Typesense 30.1, single node (non-production environment)
  • Collection with ~1.8M documents, enable_nested_fields: true, including auto-embedding fields (ts/paraphrase-multilingual-mpnet-base-v2, CPU)

What happened

  1. An alter was issued against the ~1.8M-document collection.
  2. GET /operations/schema_changes showed validation complete and alter progress of roughly 2,000 docs/minute. At that rate it would need about 15 hours:
    json
    [{"alter_history": [], "altered_docs": 344000, "collection": "<collection>", "validated_docs": 1810236}]
  3. While the alter was running, writes to other collections on the same node were also blocked, not only writes to the altered collection:
    • /stats.json reported pending_write_batches: 10, unchanged for 10+ minutes.
    • POST /collections (creating an unrelated, new collection) and DELETE /collections/<unrelated-name> timed out.
    • Reads and searches kept working.
  4. We restarted the node. The alter was replayed from the log and restarted from zero (altered_docs went from ~344000 back to ~22000, and validation ran again). The write queue stayed blocked.

Expected / requested

  1. A cancel endpoint, e.g. DELETE /operations/schema_changes/:collection or POST /operations/schema_changes/:collection/cancel. It would stop the alter, roll back any partially applied field changes, and record the cancellation in the Raft log so the alter is not replayed on restart.
  2. Clarify the blocking scope. The docs say writes to the affected collection are blocked. We observed writes to unrelated collections (including create/delete collection) blocked as well. Either this is a bug, or the docs should say that the whole write path is blocked.
  3. Resume instead of restart. After a node restart the alter should resume from its progress rather than starting over. Otherwise cancellation should be possible before the replay.
  4. More detail from /operations/schema_changes. alter_history was empty. Seeing which fields are being changed and when the alter started would make it much easier to find what triggered a long-running alter.
  5. (Optional) A warning or guard when an alter adds an auto-embedding field to a large collection, since that implies computing embeddings for every document while writes are blocked.

Workaround we found

Server configuration documents --skip-writes, which skips replaying writes from the Raft log. It works as an emergency stop, but it also drops every other write that is not yet in a snapshot. That is too blunt for "cancel this one alter", which is why a first-class cancel would help.