Skip to content

💾 Introduce raw RDB loading falling back to sanitised RDB load strategy#51

Open
gregjoy1 wants to merge 59 commits intomainfrom
feature/introduce-claude-gsd
Open

💾 Introduce raw RDB loading falling back to sanitised RDB load strategy#51
gregjoy1 wants to merge 59 commits intomainfrom
feature/introduce-claude-gsd

Conversation

@gregjoy1
Copy link
Owner

@gregjoy1 gregjoy1 commented Mar 9, 2026

Currently RediCal dumps all Calendar RDB key data as a structured serialized iCal payload (the "logical dump") which is then re-parsed on load. This is great because it is version agnostic and robust, the major downside of this is that it is slow to load/rehydrate large
Calendar key values.

The changes in this PR work to improve on this by wrapping this logical dump in an envelope (RDBCalendarEnvelope) alongside a raw bincode serialization of the Calendar. If the RediCal build version recorded in the envelope lines up with the current version, it deserializes the
raw dump directly (much faster), falling back to the logical dump if there are any issues.

This PR also introduces GSD planning artefacts (experimentally used in implementing this feature).

gregjoy1 added 30 commits March 6, 2026 09:40
…rom_utf8_unchecked

- Bump redis-module and redis-module-macros to 2.0.4 in both Cargo.toml files
- Replace todo!() in aof_rewrite with empty stub + explanatory comment
- Replace from_utf8_unchecked + save_string with raw::save_slice in rdb_save
- Add 01-01-SUMMARY.md
- Update STATE.md with decisions, metrics, session
- Update ROADMAP.md phase 1 progress
- Mark SAFE-01, SAFE-02, UPGR-01 complete in REQUIREMENTS.md
- Enable chrono serde feature in workspace
- Add serde dependency to redical_ical
- Custom Serialize/Deserialize for Tzid (chrono_tz::Tz lacks serde)
- Derive Serialize, Deserialize on PositiveNegative enum
- Values: Text, Integer, Float, Date, Time, Duration, ClassValue,
  Reltype, DateTime, ValueType, List<T>, Recur, Frequency, WeekDay,
  WeekDayNum
- Content line: ContentLineParam, ContentLineParams, ContentLine
- Properties: UID, LastModified, Calendar, DTStart, DTEnd, Duration,
  RRule, ExRule, RDate, ExDate, Categories, LocationType, Class, Geo,
  RelatedTo, Passive, EventProperty, EventProperties
- build_ical_param! macro generates types with serde derives
- No query-only or index types modified
- SUMMARY, STATE, ROADMAP, REQUIREMENTS updated
- SERD-01, SERD-02, SERD-05 marked complete
…notations

- KeyValuePair, GeoPoint, EventOccurrenceOverride derive serde
- ScheduleProperties derives serde, parsed_rrule_set skipped
- IndexedProperties, PassiveProperties derive serde
- Event derives serde, 5 computed index fields skipped
- Calendar derives serde, 5 computed index fields skipped
- indexes_active NOT skipped (source state)
- test_calendar_bincode_round_trip: serialize/deserialize/rebuild/equality
- test_empty_calendar_bincode_round_trip: empty calendar round-trip
- Full serde derive chain verified end-to-end
- SUMMARY.md with task commits and decisions
- STATE.md advanced to plan 2 of phase 2
- ROADMAP.md and REQUIREMENTS.md updated
gregjoy1 added 29 commits March 6, 2026 15:57
- RDBCalendarDump with version, raw_dump, dump fields
- Two bincode round-trip tests (with/without version)
- BUILD_VERSION const from option_env!(GIT_SHA)
- rdb_save now writes envelope with bincode raw_dump + iCal fallback
- All existing tests pass including integration
- SUMMARY, STATE, ROADMAP, REQUIREMENTS updated
- Envelope (RDBCalendarDump) attempted first, legacy RDBCalendar on failure
- Fast path gated on BUILD_VERSION match, wrapped in catch_unwind
- Both bincode deser and rebuild_indexes inside catch_unwind scope
- iCal fallback from envelope.dump on fast-path failure/version mismatch
- Appropriate log levels: debug (success), warning (fallback), notice (legacy)
- Test envelope with None version (iCal fallback within envelope path)
- Test legacy bytes (bare RDBCalendar deserialization)
- Test corrupted raw_dump in envelope (fallback to iCal from dump)
- Add log wrapper module to safely no-op redis logging in test mode
- test_helpers.rs with override-enriched Calendar builder and fixture_path helper
- mod.rs load_tests now imports shared helper instead of inline fn
- All 3 existing load_tests pass with enriched calendar
- #[ignore]-gated generate_fixtures test in rdb_data.rs
- rdb_calendar_legacy.bin: bare RDBCalendar bincode bytes with override
- rdb_calendar_dump_mismatch.bin: RDBCalendarDump with mismatched version
- SUMMARY.md with execution results
- STATE.md advanced to phase 4 plan 1
- ROADMAP.md and REQUIREMENTS.md updated
- Legacy fixture loads correctly via load_legacy (TEST-04)
- Mismatch fixture falls back to iCal via load_from_envelope (TEST-05)
- Envelope serialize/deserialize round-trip produces identical Calendar (TEST-06)
Fixes bug where RDB envelope loading did not rebuild parsed rrule set,
breaking queries because event instances could not be extrapolated.
Adds validation step before index rebuild in Event and updates all
call sites and comments to reflect the new name.
Changes:
* `RDBCalendarDump` → `RDBCalendarEnvelope`, `.dump` → `.logical_dump`
* `load_from_dump_envelope` → `load_from_envelope`
* `load_from_legacy_ical_dump` → `load_from_logical_dump`
* fixture files renamed accordingly.
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