75.6 Configuring Persistent Storage

The <persistent_storage> tag is used to persist DDS samples into permanent storage. If the <persistent_storage> tag is not specified, the service will operate in TRANSIENT mode and all the data will be kept in memory. Otherwise, the persistence service will operate in PERSISTENT mode and all the topic data will be stored on the filesystem.

Table 75.3 Persistent Storage tags lists the tags that you can specify in <persistent_storage>.

Table 75.3 Persistent Storage tags

Tags within <persistent_storage>

Description

Number of Tags Allowed

<filesystem>

When this tag is present, the topic data will be persisted into files.

See Table 75.4 Filesystem tags.

1

(required)

<restore>

This DDS_Boolean (see 75.2.1 Configuration File Syntax) indicates if the topic data associated with a previous execution of the persistence service must be restored or not. If the topic data is not restored, it will be deleted from the persistent storage.

Restoring the topic data associated with a previous execution of the Persistence Service requires you to do the following:

  • Use the same <persistence_service> configuration name (-cfgName; see 76.1 Starting the Persistence Service Executable) that was used to persist the data.
  • For each <participant> (see 75.7 Configuring Participants) whose topic data should be restored, use the same name attribute in XML as the previous execution that persisted the data. By default this attribute is set to a random anonymous value. For persisted data to be restored, you must explicitly set this value to the same string.

Default: true

0 or 1

<type_object_max_

serialized_length>

Defines the length in bytes of the database column used to store the TypeObjects associated with PRSTDataWriters and PRSTDataReader.

For additional information on TypeObjects, see the RTI Connext Core Libraries Extensible Types Guide.

Default: 10488576

0 or 1

 

Table 75.4 Filesystem tags

Tags within <filesystem>

Description

Number of Tags Allowed

<directory>

Specifies the directory of the files in which topic data will be persisted. There will be one file per PRSTDataWriter/PRSTDataReader pair.

The directory must exist; otherwise the service will report an error upon start up.

Default: current working directory

0 or 1

<file_prefix>

A name prefix associated with all the files created by Persistence Service.

Default: PS

0 or 1

<journal_mode>

Sets the journal mode of the persistent storage. This tag can take these values:

  • DELETE: Deletes the rollback journal at the conclusion of each transaction.
  • TRUNCATE: Commits transactions by truncating the rollback journal to zero-length instead of deleting it.
  • PERSIST: Prevents the rollback journal from being deleted at the end of each transaction. Instead, the header of the journal is overwritten with zeros.
  • MEMORY: Stores the rollback journal in volatile RAM. This saves disk I/O.
  • WAL: Uses a write-ahead log instead of a rollback journal to implement transactions.
  • OFF: Completely disables the rollback journal. If the application crashes in the middle of a transaction when the OFF journaling mode is set, the files containing the DDS samples will very likely be corrupted.

Default: WAL

0 or 1

<synchronization>

Determines the level of synchronization with the physical disk.

This tag can take three values:

  • FULL: Every DDS sample is written to physical disk as Persistence Service receives it.
  • NORMAL: DDS samples are written to disk at critical moments.
  • OFF: No synchronization is enforced. Data will be written to physical disk when the OS flushes its buffers.

Default: NORMAL

0 or 1

<trace_file>

Specifies the name of the trace file for debugging purposes. The trace file contains information about all SQL statements executed by the persistence service.

Default: No trace file is generated

0 or 1

<vacuum>

Sets the auto-vacuum status of the storage. This tag can take these values:

  • NONE: When data is deleted from the storage files, the files remain the same size.
  • FULL: The storage files are compacted every transaction.

Default: FULL

0 or 1