Skip to content

Commit 9fa7bf7

Browse files
emmaling27Convex, Inc.
authored andcommitted
Write schema validation progress (#40553)
In this PR, we start writing schema validation progress in the schema worker. Adds `SchemaValidationProgressTracker` to manage the logic of updating progress without doing too many writes (sets an arbitrary threshold of 500 docs or 5% of the number of documents to validate). Schema validation progress only exists for `Pending` and `Validated` schemas. When we mark a schema as `Overwritten`, `Active`, or `Failed`, the progress document is deleted. This has a nice side effect in notifying the schema worker in the case that another schema has been submitted or a document update failed validation, so we can stop validating the schema when we encounter missing schema progress. This fixes an issue where the worker would have to run schema validation to completion on a previous pending schema when a new pending schema is submitted (e.g. if someone pushes code, realizes their schema will take too long to validate, and fixes it, they still would have to wait for the first schema validation to complete). With this change, that's no longer the case. Fixes [ENG-9710](https://linear.app/convex/issue/ENG-9710/schema-validation-cancelation) GitOrigin-RevId: c6e725b36f4b0f26bb1d601ee3e9dfecce5e141b
1 parent 23afd5b commit 9fa7bf7

File tree

7 files changed

+536
-130
lines changed

7 files changed

+536
-130
lines changed

0 commit comments

Comments
 (0)