86.8 Creating Persistence Groups

The topics that must be persisted in a specific domain ID are specified using <persistence_group> tags. A <persistence_group> tag defines a set of topics identified by a POSIX expression.

For example:

<participant name="Part1">
    <domain_id>71</domain_id>
    <persistence_group name="PerGroup1" filter="H*">
       ...
    </persistence_group>
</participant>

In the above example, the persistence group 'PerGroup1' is associated with all the topics published in DDS domain 71 whose name starts with 'H'.

When a participant discovers a topic that matches a persistence group, it will create a PRSTDataReader and a PRSTDataWriter. The PRSTDataReader and PRSTDataWriter will be configured using the QoS policies associated with the persistence group. The DDS samples received by the PRSTDataReader will be persisted in the queue of the corresponding PRSTDataWriter.

A <participant> tag can contain multiple persistence groups; the set of topics that each one represents can intersect.

Table 86.6 Persistence Group Tags further describes the persistence group tags.

Table 86.6 Persistence Group Tags

Tags within <persistence_group>

Description

Number of Tags Allowed

<allow_durable_subscriptions>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that enables support for durable subscriptions in the PRSTDataWriters created in a persistence group.

When Durable Subscriptions are not required, setting this property to 0 will increase performance.

Default: true

0 or 1

<content_filter>

Content filter topic expression. A persistence group can subscribe to a specific set of data based on the value of this expression.

A filter expression is similar to the WHERE clause in SQL. For more information on the syntax, please see the API Reference Documentation (from the Modules page, select RTI Connext API Reference, Queries and Filters Syntax).

Default: no expression

0 or 1

<datareader_qos>

PRSTDataReader QoS.1See 86.8.1 QoSs.

Default: DDS defaults

0 or 1

<datawriter_qos>

PRSTDataWriter QoS.2 See 86.8.1 QoSs.

Default: DDS defaults

0 or 1

<deny_filter>

Specifies a list of POSIX expressions separated by commas that describe the set of topics to be denied in the persistence group.

This "black" list is applied to the topics that pass the filter specified with the <filter> tag

Default: empty

0 or 1

<filter>

Specifies a list of POSIX expressions separated by commas that describe the set of topics allowed in the persistence group.

The filter can be specified as an attribute of <persistence_group> as well.

Default: *

0 or 1

<memory_management>

This flag configures the memory allocation policy for DDS samples in PRSTDataReaders and PRSTDataWriters.

See 86.8.4 Memory Management.

0 or 1

<propagate_dispose>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that controls whether or not the persistence service propagates dispose messages from DataWriters to DataReaders.

When this tag is set to true, Persistence Service propagates dispose samples, but it doesn't propagate the key value for those dispose samples. Therefore, a DataReader receiving samples from the Persistence Service may not be able to access the key value for an instance if the first and only sample that it received is a dispose sample of that instance.

Default: true

0 or 1

<propagate_source_timestamp>

A DDS_Boolean (see 86.2.1 Configuration File Syntax). When this tag is true, the DDS data samples sent by the PRSTDataWriters preserve the source timestamp that was associated with them when they were published by the original DataWriter.

Default: false

0 or 1

<propagate_unregister>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that controls whether or not the persistence service propagates unregister messages from DataWriters to DataReaders.

Default: false

0 or 1

<propagate_related_source_guid>

A DDS_Boolean (see 86.2.1 Configuration File Syntax). When this tag is true, the DDS data samples sent by the PRSTDataWriters preserve the related source GUID that was associated with them when they were published by the original DataWriter. The related source GUID can be set by using the related_source_guid field in DDS_WriteParams_t (see 34.8 Writing Data).

This option is ignored and treated as false when data synchronization is enabled by setting <data_synchronization>/<enable> (see 86.10 Synchronizing of Persistence Service Instances) to true.

Default: false

0 or 1

<publisher_qos>

Publisher QoS. See 86.8.1 QoSs.

Default: DDS defaults

0 or 1

<reader_checkpoint_frequency>

This property controls how often (expressed as a number of DDS samples) the PRSTDataReader state is stored in the database. The PRSTDataReaders are the DataReaders created by the persistence service.

A high value will provide better performance. However, if the persistence service is restarted, it may receive some duplicate DDS samples. The persistence service will send these duplicates DDS samples on the wire but they will be filtered by the DataReaders and they will not be propagated to the application.

This property is only applicable when the persistence service operates in persistent mode (the <persistent_storage> tag is present).

Default: 1

0 or 1

<single_publisher>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that indicates if the persistence service should create one Publisher per persistence group or one Publisher per PRSTDataWriter inside the persistence group. If set to true, the persistence service creates one Publisher per persistence group; if false, it creates one Publisher per PRSTDataWriter inside the persistence group. See 86.8.3 Sharing a Publisher/Subscriber.

Default: false

0 or 1

<single_subscriber>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that indicates if the persistence service should create one Subscriber per persistence group or one Subscriber per PRSTDataReader in the persistence group. If set to true, the persistence service creates one Subscriber per persistence group; if false, it creates one Subscriber per PRSTDataReader in the persistence group.

See 86.8.3 Sharing a Publisher/Subscriber.

Default: false

0 or 1

<subscriber_qos>

Subscriber QoS. See 86.8.1 QoSs.

Default: DDS defaults

0 or 1

<topic_qos>

Topic QoS. See 86.8.1 QoSs.

Default: DDS defaults

0 or 1

<use_durability_service>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that indicates if the HISTORY and RESOURCE_LIMITS QoS policy of the PRSTDataWriters and PRSTDataReaders should be configured based on the DURABILITY SERVICE value of the discovered DataWriters.

See 86.8.2 DurabilityService QoS Policy

Default: false

0 or 1

<writer_ack_period>

Controls how often (expressed in milliseconds) DDS samples are marked as ACK'd in the database by the PRSTDataWriter.

Default: 0

0 or 1

<writer_checkpoint_period>

Controls how often (expressed in milliseconds) transactions are committed for a PRSTDataWriter.

A value of 0 indicates that transactions will be committed immediately. This is the recommended setting to avoid losing data in the case of an unexpected error in Persistence Service and/or the underlying hardware/software infrastructure.

For applications that can tolerate some data losses, setting this tag to a value greater than 0 will increase performance.

Default: 0

0 or 1

<writer_checkpoint_volume>

Controls how often (expressed as a number of DDS samples) transactions are committed for a PRSTDataWriter.

A value of 1 indicates that DDS samples will be persisted by the PRSTDataWriters immediately. This is the recommended setting to avoid losing data in the case of an unexpected error in persistence service and/or the underlying hardware/software infrastructure.

For applications that can tolerate some data losses, setting this tag to a value greater than 1 will increase performance.

Default: 1

0 or 1

<late_joiner_read_batch>

Defines how many DDS samples will be pre-fetched by a PRSTDataWriter to satisfy requests from late-joiners.

When a DataReader requests DDS samples from a PRSTDataWriter by sending a NACK message, the PRSTDataWriter may retrieve additional DDS samples from the database to minimize disk access.

This parameter determines the number of DDS samples that the PRSTDataWriter will preemptively retrieve from the database.

Default: 20000

0 or 1

<sample_logging>

This tag can be used to enable and configure a DDS sample log for the PRSTDataWriters in a persistence group. A DDS sample log is a buffer of DDS samples on disk that, when used in combination with delegate reliability, allow decoupling the original DataWriters from slow DataReaders.

For additional information on the DDS sample log, see 89.3 Scenario: Slow Consumer.

Default: DDS sample log is disabled

0 or 1

<writer_in_memory_state>

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that determines how much state will be kept in memory by the PRSTDataWriters in order to avoid accessing the persistent storage.

The property is only applicable when the persistence service operates in persistent mode (the <persistent_storage> tag is present).

If this property is true, the PRSTDataWriters will keep a copy of all the instances in memory. They will also keep a fixed state overhead of 24 bytes per DDS sample. This mode provides the best performance. However, the restore operation will be slower and the maximum number of DDS samples that a PRSTDataWriter can manage will be limited by the available physical memory.

If this property is false, all the state will be kept in the underlying persistent storage. In this mode, the maximum number of DDS samples that a PRSTDataWriter can manage will not be limited by the available physical memory.

Default: If the HistoryQosPolicy‘s kind is KEEP_LAST or the ResourceLimitsQosPolicy’s max_samples != DDS_LENGTH_UNLIMITED, the default is true. Otherwise, the default is false.

0 or 1

<use_wait_set> (DEPRECATED)

This tag is deprecated. If you attempt to set its value to false, the configuration will not be applied. An error message will be issued, and the value will remain set to true.

A DDS_Boolean (see 86.2.1 Configuration File Syntax) that indicates if Persistence Service will use Waitsets or Listeners to read data from the PRSTDataReaders of the group.

By default, the usage of Waitsets is enabled. With this configuration, Persistence Service will use them to read the data:

  • If <single_subscriber> is set to true, there will be a single Waitset and a read thread shared across all the PRSTDataReaders in the group.
  • If <single_subscriber> is set to false, there will be a Waitset and a read thread per PRSTDataReader in the group.

When enabled, the write operation in a PRSTDataWriter is called by the read thread associated with the PRSTDataReader.

When disabled, Persistence Service uses the on_data_available() listener callback to take the data from the PRSTDataReaders within the persistence group. The write operation in a PRSTDataWriter is called within the listener callback.

Default: true

0 or 1