Skip to main content

Administrating MarkLogic Server

Making a Forest Read-Only

You can configure an existing forest to allow only reads and to disallow inserts, updates and deletes to any documents stored in the forest through the updates allowed field on the Create New Forests or the Configure Forests page.

MarkLogic Server supports two read-only forest settings:

  • read-only — When this update type is set, update transactions on the forest are immediately aborted.

  • flash-backup — When this update type is set, update transactions on the forest are retried until either the update type is reset or the Default Time Limit set for the App Server is reached.

Note

Only existing forests can be set to read-only or flash-backup. You cannot create a new forest with these settings.

A read-only forest is useful if you want to put your forests on read-only media and allow them to be queried. Another use of read-only is to control disk space. For example, in a multi-forest database, it might be useful to be able to mark one or more forests as read-only as they reach disk space limits.

One use for flash-backup is to prevent updates to the forest during a flash backup operation, which is a very fast backup that can be done on some file systems. You can set the flash-backup update type to temporarily put the forest in read-only mode for the duration of a flash backup and then reset the update type when the backup has completed. Transactions attempting to make changes to the forest during the backup period are retried.

Note

Toggling between read-only or flash-backup and other forest update types triggers a forest restart. This activity is visible in the log file.

When the read-only or flash-backup update type is set, the forest will have the following characteristics:

  • If a database has at least one updatable forest, and an insert, update or delete without a place key is requested, it will choose one of the updateable forests to perform the operation.

  • No merges are allowed on the forest. Attempts to explicitly merge such forests do nothing.

  • No re-indexing/re-fragmenting is allowed on the forest.

  • You cannot upgrade from the forest. An attempt to upgrade will return an error.

  • If a forest is set to read-only or flash-backup, an insert, update, or delete transaction will either generate an exception (in the case of read-only) or retried later (in the case of flash-backup).

  • You cannot clear, restore, or fully delete the forest. However, you can delete the forest configuration, as described in Deleting a Forest from a Host.

  • Backups are permitted on the forests. However, they will not modify the last backup time in the forest label. Consequently, the last backup time in the forest will denote the last time the forest was backed up when it wasn't read-only or flash-backup.

  • If the database index settings are changed and index detection is set to ‘automatic’, then the forests will work, but the indexes won't be picked up. If index detection is set to ‘none’, you will get wrong results.

  • You can enable failover on a read-only and flash-backup forest.