fix: TemplateStore eviction cleanup, error reporting, and doc accurac… - #294
Merged
Conversation
…y (1.0.4) - AutoScopedParser source eviction now clears the evicted parser's templates from the store before drop (prevents monotonic keyspace growth in long-running multi-tenant deployments). - clear_v9_templates / clear_ipfix_templates record template_store_backend_errors on remove failures (previously swallowed via let _ = ...). - Honest doc comment on clear_*_templates in-LRU-only semantics. - set_template_store_scope / with_template_store_scope rustdoc warnings about scope-change orphan windows and AutoScopedParser overrides. - template_store_restored doc clarifies hit-not-miss semantics and TTL re-stamping behavior. Tests: - Rewrote vacuous read_through_drives_pending_flow_replay to actually queue a pending flow before any template is known, then verify read-through restores the template AND replays the queued flow. - Strengthened auto_scoped_parser_uses_per_source_scope with a cross-replica round-trip read-through assertion. - New tests: AutoScopedParser eviction store cleanup, clear_*_templates backend-error counting, IPFIX codec corruption, IPFIX LRU eviction propagation, IPFIX TemplateEvent::Restored firing. - inject_remove_failures is no longer dead code. Example: - New horizontal_scale_out_template_store example demonstrates two parser replicas sharing an InMemoryTemplateStore — replica A learns and goes away, replica B starts cold and decodes via read-through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ata flowset NetflowPacket::V9 can wrap a FlowSetBody::NoTemplate without returning an error, so matching only on NetflowPacket::V9(_) would have passed even if the read-through silently missed or hit the wrong scope's template. Assert FlowSetBody::Data(_) on the first flowset to actually verify the scoped read-through resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…y (1.0.4)
Tests:
Example: