TRANSIENT and PERSISTENT DDS durability can supply historical data to readers that join after the original write. It is tempting to picture the durability service as an unlimited archive. DDS DURABILITY_SERVICE QoS says otherwise: cleanup delay, history kind and depth, and resource limits determine what the service retains for each instance. A late reader receives the history that remains eligible under those policies, not every value ever published.
The implied durability reader
DDS 1.4 describes TRANSIENT and PERSISTENT durability as if the service maintained built-in DataReader and DataWriter entities for the topic. The durability service's storage behavior is configured through DURABILITY_SERVICE on the Topic and DataWriter. Its history_kind and history_depth act like HISTORY QoS for an implied reader. Its max_samples, max_instances, and max_samples_per_instance act like RESOURCE_LIMITS.
The default history is KEEP_LAST with depth 1, while the default resource limits are LENGTH_UNLIMITED. That default means the service is normally asked to keep only the most recent sample per instance, even though the numeric resource limits do not impose a smaller bound. An operator who expects a complete event log from persistent durability can therefore be surprised by perfectly conforming last-value behavior.
service_cleanup_delay controls when the transient or persistent service may remove all information for a data instance after it no longer needs to retain it according to lifecycle semantics. A zero cleanup delay permits immediate reclamation when the conditions apply. A longer delay can preserve instance information for a later reader, but it is not a universal retention period for every sample. History, lifespan, disposal, resource limits, and writer lifecycle still matter.
History decides which versions survive
With KEEP_LAST depth 1, a robot's ten status updates can collapse to the newest retained value before a late reader joins. With depth 5, the service can retain up to the latest five values per instance, subject to limits. KEEP_ALL asks to retain all values but still depends on capacity and reliability behavior.
Consider a topic keyed by robot_id. Robot-17 publishes revisions 101 through 110 before a diagnostic reader starts. If the durability service uses KEEP_LAST depth 3, the reader can at most receive revisions 108, 109, and 110 from that history. A service_cleanup_delay of one hour does not restore revisions 101 through 107; they were removed by the history policy, not the cleanup timer.
Global limits can reduce the practical result. One hundred robots with depth 10 could require 1,000 sample slots. If max_samples is 300, the service cannot fully populate the requested depth for every active key at once. max_instances can also prevent new keys from being retained, and max_samples_per_instance caps one key independently.
Cleanup is not lifespan
LIFESPAN gives each sample an expiration time based on its source timestamp. Expired samples should be removed from durability caches regardless of a longer cleanup delay. Cleanup delay concerns when all information for an instance may be removed after lifecycle conditions; lifespan concerns whether an individual sample remains valid for delivery. Configure and observe them separately.
Disposal also carries meaning. A disposed instance tells readers that the keyed object no longer exists. Historical samples and instance-state information can be presented according to durability and lifecycle rules. Treating dispose as a storage cleanup shortcut can cause a late reader to see a deletion state instead of a current value.
Design for the reader's startup question
Decide whether a late reader needs the latest state, a bounded revision window, or a complete audit trail. Latest state often fits KEEP_LAST depth 1 plus an application revision and freshness check. Recovery from brief disconnects may need a deeper bounded history. A complete audit trail usually belongs in a dedicated log or database because DDS durability is optimized for data distribution semantics, not regulatory archival.
Size limits from the maximum active instance count and desired per-instance depth. Include payload and middleware overhead. If different consumers need different startup histories, consider separate topics or an explicit snapshot service rather than one oversized durability cache.
The reader must validate what it gets. Check revision continuity, source age, schema version, and instance state. wait_for_historical_data can help synchronize with historical delivery, but successful completion does not prove that an expected revision still exists. The history may have been trimmed or expired before the reader joined.
Test lifecycle boundaries
Publish a known sequence for multiple keys, stop all writers, then join readers at several times. Vary KEEP_LAST depth, KEEP_ALL, service_cleanup_delay, lifespan, max_samples, max_instances, and max_samples_per_instance. Unregister an instance in one test and dispose it in another. Restart the durability service if PERSISTENT behavior is supported and verify what survives.
Force capacity exhaustion and observe status, blocking, loss, or rejection behavior. Create more instances than max_instances. Fill one key beyond max_samples_per_instance. Confirm that late readers receive only the retained suffix and that application logs explain missing revisions.
Observe configuration and outcome
Record the Topic and DataWriter DURABILITY and DURABILITY_SERVICE settings, active instance count, stored sample count, high-water marks, sample source times, lifespan, disposal state, and cleanup actions. When a late reader sees no data, distinguish QoS incompatibility, no stored sample, expired sample, cleaned instance, and resource exhaustion.
DDS durability can bridge time between writers and late readers, but DURABILITY_SERVICE defines a bounded, lifecycle-aware cache. Cleanup delay governs when instance information may be reclaimed; history and resource limits govern how much is available; lifespan governs how long each sample remains valid. State the startup requirement first, then prove the configured cache can satisfy it.