Tar MK Corruption | Community
Skip to main content
Level 5
Dec 2, 2019 11:50 AM UTC
Solved

Tar MK Corruption

As given in all the documentation, the solution to TarMK corruption is to run the 'check' run-mode on oak-run jar and revert the repository to the last known good revision by making changes to journal.log.

But doing this would wipe out some of the recent data from the repository. Is there a way to know what data or content has been erased by reverting to an earlier revision? Also what would be the best way to get this data back?

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
leoberliantAccepted solution
Employee
Dec 2, 2019 2:35 PM UTC

When you determine the latest good revision, you can find the approximate date and time of that revision:

Offline Compaction fails with SegmentNotFoundException & IllegalArgumentException step 4.

Next, you can query your JCR by date of creation and modification. For example, for cq:Pages you can use a query similar to:

/jcr:root/content//element(*,cq:Page)[(jcr:content/@cq:lastModified >= xs:dateTime('2015-11-03T04:00:00.000-05:00') and

jcr:content/@cq:lastModified <= xs:dateTime('2015-11-03T20:00:00.000-05:00')) or (jcr:content/@jcr:created >= xs:dateTime('2015-11-03T04:00:00.000-05:00')

and jcr:content/@jcr:created <= xs:dateTime('2015-11-03T20:00:00.000-05:00')) ]

The result can be packaged via Query Packager

That is the best option to backup the content that will be wiped up by reverting to the latest good revision.

5 replies

Employee
Dec 4, 2019 6:28 PM UTC

When you run the groovy script, It will list the paths that have been corrupted.

You can then delete those paths using the groovy script and create a package of these nodes from other instances.

Translate
Level 5
Dec 2, 2019 8:42 PM UTC

Thanks. In this case (approach B) how do you find which data is lost and what'd be the best way to restore that?

Translate
Level 5
Dec 2, 2019 8:27 PM UTC

This helps a lot thanks.

Translate
leoberliantAccepted solution
Employee
Dec 2, 2019 2:35 PM UTC

When you determine the latest good revision, you can find the approximate date and time of that revision:

Offline Compaction fails with SegmentNotFoundException & IllegalArgumentException step 4.

Next, you can query your JCR by date of creation and modification. For example, for cq:Pages you can use a query similar to:

/jcr:root/content//element(*,cq:Page)[(jcr:content/@cq:lastModified >= xs:dateTime('2015-11-03T04:00:00.000-05:00') and

jcr:content/@cq:lastModified <= xs:dateTime('2015-11-03T20:00:00.000-05:00')) or (jcr:content/@jcr:created >= xs:dateTime('2015-11-03T04:00:00.000-05:00')

and jcr:content/@jcr:created <= xs:dateTime('2015-11-03T20:00:00.000-05:00')) ]

The result can be packaged via Query Packager

That is the best option to backup the content that will be wiped up by reverting to the latest good revision.

Translate
Employee
Dec 2, 2019 2:23 PM UTC

There is another way to find the corrupted nodes and remove them manually. Check the "B. Remove corrupted nodes manually." at [1]

[1] Offline Compaction fails with SegmentNotFoundException & IllegalArgumentException

Translate