<- Back to NucleoCore
Skip to main content

Cluster Locks

Cluster wide DataEntry locks.

You can lock a DataEntry by specifying in the copy step that you want to lock the entry. This will send a request to lock the entry to all of the running instances of NucleoDB.

flowchart TD
    K[Kafka Cluster]
    NB1[NDB Application1]
    NB2[NDB User1]
    NB3[NDB User2]
    C[Controller] -->|1: LOCK WAIT| NB1
    NB1 -->|2: REQUEST LOCK| K
    K --> |3: LOCK REQUEST RECEIVED| NB1
    K --> |3: LOCK REQUEST RECEIVED| NB2
    K --> |3: LOCK REQUEST RECEIVED| NB3
    NB1 --> |4: SET ACTIVE LOCK| NB1
    NB2 --> |4: SET ACTIVE LOCK| NB2
    NB3 --> |4: SET ACTIVE LOCK| NB3
    NB1 --> |5: LOCK SUCCESS, NOTIFY WAIT| C
    C --> |6: SAVE ENTRY| NB1
    NB1 -->|7: RELEASE LOCK| K
    K -->|8: REMOVE LOCK| NB1
    K -->|8: REMOVE LOCK| NB2
    K -->|8: REMOVE LOCK| NB3
    NB1 -->|9: DELETE LOCK FOR ENTRY| NB1
    NB2 -->|9: DELETE LOCK FOR ENTRY| NB2
    NB3 -->|9: DELETE LOCK FOR ENTRY| NB3

image.png

 

 

 

 

 

sequenceDiagram
  Controller-->> NDBApplication1: LOCK WAIT
  NDBApplication1-->>KafkaCluster: REQUEST LOCK
  KafkaCluster-->>+NDBApplication1: LOCK REQUEST RECEIVED
  KafkaCluster-->>+ NDBUser1: LOCK REQUEST RECEIVED
  KafkaCluster-->>+ NDBUser2: LOCK REQUEST RECEIVED
  NDBApplication1 -->>+ NDBApplication1: SET ACTIVE LOCK
  NDBUser1 -->>+ NDBUser1: SET ACTIVE LOCK
  NDBUser2 -->>+ NDBUser2: SET ACTIVE LOCK
  NDBApplication1-->>+Controller: LOCK SUCCESS, NOTIFY WAIT
  Controller-->>+NDBApplication1: SAVE ENTRY
  NDBApplication1-->>+KafkaCluster: RELEASE LOCK REQUEST
  KafkaCluster -->>+NDBApplication1: RELEASE LOCK
  KafkaCluster -->>+NDBUser1: RELEASE LOCK
  KafkaCluster -->>+NDBUser2: RELEASE LOCK
  NDBApplication1 -->>+NDBApplication1:DELETE LOCK FOR ENTRY
  NDBUser1 -->>+NDBUser1: DELETE LOCK FOR ENTRY
  NDBUser2 -->>+NDBUser2: DELETE LOCK FOR ENTRY