Skip to content

fix: TemplateStore eviction cleanup, error reporting, and doc accurac… - #294

Merged
mikemiles-dev merged 3 commits into
mainfrom
fix/template-store-cleanup-1.0.4
May 9, 2026
Merged

fix: TemplateStore eviction cleanup, error reporting, and doc accurac…#294
mikemiles-dev merged 3 commits into
mainfrom
fix/template-store-cleanup-1.0.4

Conversation

@mikemiles-dev

Copy link
Copy Markdown
Owner

…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.

mikemiles-dev and others added 3 commits May 8, 2026 21:19
…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.
@mikemiles-dev
mikemiles-dev merged commit 10b65d0 into main May 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant