Skip to content

Implement bd-state uploads with persistent storage default#385

Open
snowp wants to merge 4 commits intomainfrom
state-uploads
Open

Implement bd-state uploads with persistent storage default#385
snowp wants to merge 4 commits intomainfrom
state-uploads

Conversation

@snowp
Copy link
Contributor

@snowp snowp commented Jan 29, 2026

Summary

  • Implement state snapshot uploads to ensure logs can be correlated with state on the server
  • Default UsePersistentStorage to true so persistent storage is used from first launch
  • Track and report when state storage falls back to in-memory mode via SDKConfigured event

Changes

State Upload Implementation

  • Add StateUploadManager to coordinate state snapshot uploads alongside log uploads
  • Implement snapshot correlation: when logs reference a state sequence, upload the corresponding snapshot
  • Add cooldown mechanism to prevent excessive on-demand snapshot creation
  • Support both existing snapshots from normal rotation and on-demand snapshot creation

Persistent Storage Default

  • Change UsePersistentStorage runtime flag default from false to true
  • New installs will now use persistent storage by default, enabling state uploads to work reliably

Observability

  • Add state_storage_fallback field to Logger/LoggerHandle to track in-memory fallback
  • Include _state_storage_fallback in SDKConfigured event so server can observe fallback rate

Infrastructure

  • Add filename parsing utilities for snapshot files in bd-resilient-kv
  • Comprehensive unit and integration tests for state upload functionality

snowp added 4 commits January 28, 2026 15:31
- Change UsePersistentStorage runtime flag default from false to true so
  persistent state storage is used from first launch
- Add state_storage_fallback field to Logger/LoggerHandle to track when
  in-memory fallback occurred
- Include _state_storage_fallback in SDKConfigured event for observability
- Add filename parsing utilities for snapshot files
- Improve state upload tests and integration coverage
- Add time_provider field to StateLogCorrelator, replacing hardcoded OffsetDateTime::now_utc()
- Update builder.rs to pass time_provider to StateLogCorrelator::new()
- Update unit tests to use SystemTimeProvider or TestTimeProvider
- Remove unnecessary thread::sleep calls from integration tests
- Add panic assertion to trigger_buffer_flush_creates_snapshot test
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