Skip to main content

Administrating MarkLogic Server

Setting a Negative Merge Timestamp to Preserve Fragments for a Rolling Window of Time

If you are doing update operations and you want the ability to roll back to the point in time when you started, you can set the merge timestamp to a negative number to preserve fragments for the specified number of ticks. The ticks are calculated at 10,000,000 ticks per second.

For example, if you want to preserve deleted fragments for 24 hours (relative to the last merge), then you can set the merge timestamp to -864,000,000,000 (10,000,000 ticks/second times 60 seconds/minute times 60 minutes/hour times 24 hours/day). You can then use xdmp:forest-rollback on all of the forests in the database to roll back up to a day (or whatever time period you have set your negative merge timestamp).

If you do set a negative value for the merge timestamp parameter, keep in mind that you will keep deleted fragments for that period of time, so your database will be that much larger during that period. This could be significant, especially if you end up reloading several times during that period.

The following table shows the negative merge timestamp for specified periods of time.

Time Period to Preserve Fragments

Calculation

merge timestamp Value

5 minutes

10000000 * 60 * 5

-3000000000

1 hour

10000000 * 60 * 60

-36000000000

24 hours

10000000 * 60 * 60 * 24

-864000000000