Jackrabbit Oak
  1. Jackrabbit Oak
  2. OAK-762

MongoMK: automatic unique cluster id with few bits


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13
    • Component/s: mongomk
    • Labels:


      Currently, the cluster id of a MongoMK instance is configurable. It needs to be set when constructing the MongoMK instance, or by setting a system property. Both solutions are not nice. Instead, the cluster id should be automatically assigned unless explicitly set, and if explicitly set, the MongoMK should have a mechanism to ensure the same cluster id is not used multiple times concurrently.

      As the revision contains the cluster id, the cluster id should be a low number (ideally, the first cluster id of a cluster should be 0, the next 1, and so on). This would keep the size of the revision numbers low. To simplify support, it would be nice if the same repository uses the same cluster id after a restart, even thought this isn't strictly necessary.

      We could use the same or a similar algorithm as MongoDB uses for the machine id part of ObjectIDs.

      We could also use a persistent mapping between unique repository identifier and cluster id. The mapping itself could be stored in a MongoDB collection. The unique repository identifier (the cluster node id for Jackrabbit 2.x) could be the combination of the MAC address of the first network interface of the machine, and a guaranteed unique value within the given machine. The unique value could be the "repository home" directory (that would be nice as it survives restarts), or an incrementing number assigned by a service running on the given machine (so the first repository on this machine would get id "0", the second id "1", and so on - this would survive restarts as well in the common case where there is only one cluster node per machine).

        Issue Links


          Thomas Mueller created issue -
          Thomas Mueller made changes -
          Field Original Value New Value
          Link This issue is duplicated by OAK-731 [ OAK-731 ]
          angela made changes -
          Component/s mongomk [ 12319913 ]
          Michael Marth made changes -
          Fix Version/s 0.13 [ 12325548 ]
          Michael Marth added a comment -


          Michael Marth added a comment - duplo
          Michael Marth made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Alex Parvulescu added a comment -

          bulk close for the 0.13 release

          Alex Parvulescu added a comment - bulk close for the 0.13 release
          Alex Parvulescu made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          233d 13m 1 Michael Marth 27/Nov/13 15:51
          Resolved Resolved Closed Closed
          15d 17h 9m 1 Alex Parvulescu 13/Dec/13 09:01


            • Assignee:
              Thomas Mueller
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: