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.

Persistence Group Tags further describes the persistence group tags. For default values, please see the API Reference HTML documentation.

Persistence Group Tags

Tags within <persistence_
group>

Description

Number of Tags Allowed

<allow_durable_
subscriptions>

A DDS_Boolean (see Supported Tag Values) 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: 1

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 DDS DDS API Reference, Queries and Filters Syntax).

Default: no expression

0 or 1

<datareader_qos>

PRSTDataReader QoS1These fields cannot be set and are assigned automatically: protocol.virtual_guid, protocol.rtps_object_id, durability.kind.. See QoSs.

Default: DDS defaults

0 or 1

<datawriter_qos>

PRSTDataWriter QoS2These fields cannot be set and are assigned automatically: protocol.virtual_guid, protocol.rtps_object_id, durability.kind.. See 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: *

0 or 1

<filter>

Specifies a list of POSIX expressions separated by commas that describe the set of topics associated with 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 Memory Management.

0 or 1

<propagate_
dispose>

A DDS_Boolean (see Supported Tag Values) that controls whether or not the persistence service propagates dispose messages from DataWriters to DataReaders.

Default: 1

0 or 1

<propagate_
source_
timestamp>

A DDS_Boolean (see Supported Tag Values). When this tag is 1, 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: 0

0 or 1

<propagate_
unregister>

A DDS_Boolean (see Supported Tag Values) that controls whether or not the persistence service propagates unregister messages from DataWriters to DataReaders.

Default: 0

0 or 1

<publisher_qos>

Publisher QoS. See 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 frequency 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

<share_database_
connection>

A DDS_Boolean (see Supported Tag Values) that indicates if the persistence service will create an independent database connection per PRSTDataWriter in the group (0) or per Publisher (1) in the group.

When <single_publisher> is 0 and <share_database_connection> is 1, there is a single database connection per group. All the PRSTDataWriters will share the same connection.

When <single_publisher> is 1 or <share_database_connection> is 0, there is a database connection per PRSTDataWriter.

This parameter is only applicable to configurations persisting the data into a relational database using the tag <external_database> in <persistent_storage>.

See Sharing a Database Connection

Default: 0

0 or 1

<single_
publisher>

A DDS_Boolean (see Supported Tag Values) that indicates if the persistence service should create one Publisher per persistence group or one Publisher per PRSTDataWriter inside the persistence group. See Sharing a Publisher/Subscriber.

Default: 1

0 or 1

<single_
subscriber>

A DDS_Boolean (see Supported Tag Values) that indicates if the persistence service should create one Subscriber per persistence group or one Subscriber per PRSTDataReader in the persistence group.

See Sharing a Publisher/Subscriber.

Default: 1

0 or 1

<subscriber_qos>

Subscriber QoS. See QoSs.

Default: DDS defaults

0 or 1

<topic_qos>

Topic QoS. See QoSs.

Default: DDS defaults

0 or 1

<use_durability_
service>

A DDS_Boolean (see Supported Tag Values) 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 DurabilityService QoS Policy

Default: 0

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 application 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 paramater determines that amount of DDS samples that will be retrieved preemptively from the database by the PRSTDataWriter.

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 Scenario: Slow Consumer.

Default: DDS sample log is disabled

0 or 1

<writer_in_
memory_state>

A DDS_Boolean (see Supported Tag Values) 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 1, 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 0, 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_UNLIMITED_LENGTH, the default is 1. Otherwise, the default is 0.

0 or 1

<use_wait_set>

A DDS_Boolean (see Supported Tag Values) 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 disabled. With this configuration, 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.

When Waitsets are enabled, Persistence Service will use them to read the data:

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

If <single_subscriber> is set to 0, there will be a Waitset and a read thread per PRSTDataReader in the group.

The write operation in a PRSTDataWriter is called by the read thread associated with the PRSTDataReader.

Default: 0

0 or 1

© 2018 RTI