Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDoc-3176 Revisions Bin Cleaner #1986

Merged
merged 5 commits into from
Feb 25, 2025

Conversation

Danielle9897
Copy link
Member

@Danielle9897 Danielle9897 commented Feb 23, 2025

Related issue:
https://issues.hibernatingrhinos.com/issue/RDoc-3176/Revisions-Bin-Cleaner


Main files to review:

Info about orphaned revisions was added in:

Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/delete-revisions.dotnet.markdown
Documentation/7.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/delete-revisions.dotnet.markdown

Revision Cleaner:

Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/revisions-bin-cleaner.markdown
Documentation/7.0/Raven.Documentation.Pages/document-extensions/revisions/revisions-bin-cleaner.markdown

Audit log:

Documentation/6.2/Raven.Documentation.Pages/server/security/audit-log/audit-log.markdown

Revisions Overview:
Fixed the wrong info about orphaned revisions + updated images in v7.0

Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/overview.dotnet.markdown
Documentation/7.0/Raven.Documentation.Pages/document-extensions/revisions/overview.dotnet.markdown

Fixed the All Revisions view:

Documentation/7.0/Raven.Documentation.Pages/studio/database/document-extensions/revisions/all-revisions.markdown

The Revisions Bin view:

Documentation/7.0/Raven.Documentation.Pages/studio/database/document-extensions/revisions/revisions-bin.markdown

Other files were just copied over to v7.0 to fix the new link for Revisions Bin

To see the "orphaned" revisions (whose parent document was deleted):
Though you deleted the document, its **audit trail** is **not lost**: all its revisions are moved to the [Revisions Bin](../../studio/database/document-extensions/revisions#revisions-bin),
including a new revision (called "Delete Revision"), created to indicate that the document was deleted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not fully correct.
'Delete Revision' is created for a document that was deleted and had revisions.
'Delete Revision' won't be created for a document that was deleted and has no revisions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Though you deleted the document, its **audit trail** is **not lost**: all revisions were moved to the [Revisions Bin](../../studio/database/document-extensions/revisions#revisions-bin),
including a new revision (called "Delete-Revision"), created to indicate that the document was deleted.
Though you deleted the document, its **audit trail** is **not lost**: all its revisions are moved to the [Revisions Bin](../../studio/database/document-extensions/revisions#revisions-bin),
including a new revision (called "Delete Revision"), created to indicate that the document was deleted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct this also

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Though you deleted the document, its **audit trail** is **not lost**: all revisions were moved to the [Revisions Bin](../../studio/database/document-extensions/revisions#revisions-bin),
including a new revision (called "Delete-Revision"), created to indicate that the document was deleted.
Though you deleted the document, its **audit trail** is **not lost**: all its revisions are moved to the [Revisions Bin](../../studio/database/document-extensions/revisions#revisions-bin),
including a new revision (called "Delete Revision"), created to indicate that the document was deleted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct this also

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

4. If you remove this "Delete Revision" by providing its change vector to `DeleteRevisionsOperation`,
the "Delete Revision" will be removed from the Revisions Bin, causing the associated revisions to become orphaned.
As a result, you will no longer have access to these revisions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only in 6.0.. in 7.0 the orphaned revisions can be accessed via 'All Revisions View'.
Maybe instead of As a result, you will no longer have access to these revisions.
write As a result, you will no longer have access to these revisions via the revisions bin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. yes - I will add "via the revisions bin" as you suggest here in the 6.2 docs
  2. pls note - there is a different text addressing this in the 7.0 docs


* The delete action runs in batches. The batch size (hard-coded) depends on whether the machine is 32-bit or higher.
Older entries are deleted first.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, This is an internal implementation, should not be of interest to the user and it is better not to expose it, as I told you earlier.
Second, what you wrote here isn't fully correct.
There are 2 batch sizes: RevisionsBinCleaner._batchSize and the RevisionsBinCleanMergedCommand.MaxDeletesUponUpdate, but again, this requires a more in-depth explanation, and it shouldn't be exposed to the user.
My suggestion: remove this part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

* Regardless of how revisions are created or whether [revisions configuration](../../../../studio/database/settings/document-revisions#revisions-configuration) is enabled,
deleting a document that **has** revisions will always create a `"Delete Revision"`.
If you delete a document that does Not have revisions, a "Delete Revision" will be created only if the revisions configuration is set and enabled.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of "delete a document that does Not have revisions, a "Delete Revision" will be created only if the revisions configuration is set and enabled.", another revision is created before the delete, that has FromOldDocumentRevision flag and holds the doc content before the delete (because the delete revision does not hold the doc content, its 'empty');
Example:
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

2. The "DELETE REVISION" label indicates that you are viewing a "Delete Revision".
3. This text appears for a "Delete Revision," displaying the time when the document was removed.
The flags include the `DeleteRevision` flag, confirming it is a "Delete Revision."
4. The timestamp of the "Delete Revision".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also the time the document was deleted)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


1. The ID of the deleted document that was recreated.
2. The content of the newly created document.
3. This is the latest revision, indicating the creation of the new document.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be created only if the 'revisions configuration' existed at the time this doc was revived.
In case there is no revisions configuration when the doc is revived, the 'delete revision' will remain the last revision. BUT it won't be displayed in the revisions bin anyway after reviving the doc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

# ------------------------
# * A revision will be created anytime a document is modified or deleted.
# * Revisions of a deleted document can be accessed in the Revisions Bin view.
# * At least 100 of the latest revisions will be kept.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will keep 100 at most, not "at least". the max revisions count that document can have will be 100.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@reebhub reebhub merged commit ed6fd64 into ravendb:master Feb 25, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants