Skip to content

feat(table): skip no-op validator registration on producers that have nothing to validate #1014

@laskoviymishka

Description

@laskoviymishka

Parent: #830

After PR #934, snapshotProducer.commit() appends a validate closure to txn.validators for every producer, including fastAppendFiles and mergeAppendFiles whose validate() is a deliberate no-op. Long transactions (multi-step Append + Overwrite chains) accumulate O(N) no-op closures, all of which run at final doCommit. Cheap per call, but wasteful and noisy in profiles.

Add a small interface method to producerImpl, something like needsValidation() bool. Default to true; have fastAppendFiles and mergeAppendFiles return false. Skip the validator registration in snapshotProducer.commit() when needsValidation() is false. The no-op validate methods can stay as belt-and-suspenders or be removed once the registration is gated.

Lock the behavior with a small unit test that asserts a fast-append commit leaves txn.validators empty. Flagged as a smell in #928's round-1 review and deferred — landing it now makes the validator slice trustworthy as a registration surface.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions