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

[Cassandra] Orphan node check #87

Open
sylvlecl opened this issue May 25, 2021 · 0 comments
Open

[Cassandra] Orphan node check #87

sylvlecl opened this issue May 25, 2021 · 0 comments
Assignees

Comments

@sylvlecl
Copy link
Contributor

  • Do you want to request a feature or report a bug?

Feature

  • What is the current behavior?

It's easy to create orphan nodes (nodes without a parent): we must provide a way to identify them and delete them:

    void testOrphanNodes() {
        NodeInfo orphanNode = storage.createNode(UUIDs.timeBased().toString(), "orphanNodes", FOLDER_PSEUDO_CLASS, "", 0, new NodeGenericMetadata());
        //Following throws because data such as modification date are null for the unexisting parent node
        storage.getParentNode(orphanNode.getId());
    }
  • What is the expected behavior?

Provide an ORPHAN_NODES check in CassandraAppStorage. It will identify the nodes which have a null parent ID.
The repair will simply delete those nodes.

  • What is the motivation / use case for changing the behavior?

Being able to delete orphan nodes, which are not accessible from the user API, but may cause issues (disk usage or null pointer in some functionalities).

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)

Note that we don't perform a check on the parent existence when we create a node.
We can add this kind of check, but it adds an additional query without completely solving the issue : we could still create orphan nodes because of concurrency issues.
Therefore that tool remains necessary anyway.

@sylvlecl sylvlecl changed the title Cassandra app storage : orphan node check [Cassandra] Orphan node check May 25, 2021
@yichen88 yichen88 mentioned this issue May 27, 2021
5 tasks
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

No branches or pull requests

2 participants