Repository navigation
feat(shm): versioned object headers and payload migrations - #7
Merged
Merged
Conversation
Every named object now carries a stable ShmObjectHeader with separate
header and payload versions. The payload lives in a separate allocation
behind a relative offset, so changes to the library's bookkeeping no
longer move it.
Add ShmPersistence::{Volatile, Derived, Persistent} and per-type
v(n)->v(n+1) payload migrations. Segments whose objects are all
volatile or derived can be recreated without operator input; persistent
objects still require a migration or a registered migrator.
BREAKING CHANGE: the segment layout is version 3. Segments written by
older builds have no readable per-object header and still need the
existing migrator or LINTEL_SHM_RECREATE path.
An object written as Volatile or Derived may be authoritative for a build that now registers it as Persistent. Require both the stored and the requested persistence class to allow discarding before recreating a payload.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
The clang-tidy job analyses changed files with an explicit --checks list, which re-enables bugprone-easily-swappable-parameters and reports the new shared-memory API. Fix the code instead of loosening the gate: - bundle the version pair, the two byte counts and the type id into ShmPayloadVersionRange, ShmPayloadMigrationInput and ShmPayloadMigrationRegistration, and the payload size/alignment into ShmPayloadLayout (ShmObject::Layout stays as an alias), - give SharedMemoryType a std::uint8_t base type, - log the swallowed deallocate errors instead of leaving empty catch blocks, and guard ~SegmentSemaphoreGuard against post() throwing, - name the temporary named_semaphore whose constructor creates the lock. clang-tidy: 0 findings in 17 analysed files; unit tests 1318/1318.
The Doxygen workflow runs with WARN_AS_ERROR and fails on master at the first undocumented parameter. Complete the parameter lists of EventBusEntry, LoggerConfiguration and MessageQueueService, and name the parameters of Allocator::findOrConstructArray so its @PARAM entries resolve (the default implementation ignores them, hence [[maybe_unused]]). doxygen Doxyfile: exit 0, zero warnings.
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.
Summary
Implements stages 2-4 of
docs/shm-migration-strategy.md:ShmObjectHeaderper named object with separateheaderVersionandpayloadVersionShmPersistence::{Volatile, Derived, Persistent}at registration timev(n) -> v(n+1)payload migration registryIntegrated in
shm::SharedMemoryRepository<T>,construct*helpers, JSON mirror repositories, EventBus (volatile), MessageQueueShmCore (volatile), property mirror (derived),ShmView, cleanup and bootstrap validation.Breaking change
Segment layout is now version 3. Segments written by older builds have no readable per-object header and still need the existing migrator or
LINTEL_SHM_RECREATE=1path.Tests
tests/features/ShmObjectMigrationTest.cppcovers migration chains, persistent abort, volatile/derived recreation, automatic segment discardctest -L unit: 1318/1318 passed (PostgreSQL skipped)./scripts/check-format.sh master: passed./scripts/check-namespace.sh: passedPlan and design:
docs/shm-payload-abi-plan.md,docs/shm-migration-strategy.md.