Skip to content

[Cassandra] Orphan node check #87

@sylvlecl

Description

@sylvlecl
  • 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions