Skip to content

Universe history processing #7

Description

@viatrix

Implement a bitmap for each universe representing the path of inheritance of this universes. The history of is binary (0 for no-branch, 1 for yes-branch).

The genesis universe can have id 0, for example.
This universe is split after a fork into universes 00, 01.
After that 01 wins and it forks in 010, 011 etc.

In this way we can always check the id of the current universe (in which we want to report on this query) and always know if the first bytes contain the id of the universe where it was created.
The list of universes where the query is resolved is stored in a global query entity.
For example, we want to report a query "GLOBAL ID 5634" in a universe 011101.
The query was created in a universe 0111, we’re in the universe 011101, 0111 == 0111, first bytes match, we have a valid ancestor, we can report on the query.
Now someone wants to report on that query in a universe 01101.
0110 != 0111, not an ancestor.
This approach makes checking if a universe is the ancestor of the current one to be O(1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions