Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-501

Put DataNode API has missing transaction and error handling for concurrency issues



    • Bug
    • Status: Closed
    • Medium
    • Resolution: Done
    • Istanbul Release
    • Istanbul Release
    • CPS-Core-REST
    • None


      Two issues have been identified when running the load test

      1. Inconsistent Data: 

      The existing PUT DataNode implementation first deletes all the child fragments and then add new child fragments based on the input. These two operations are done in a separate transaction which can lead to inconsistent data if the second operation fails.

      To avoid it, we can execute both of the operations in the same transaction. However, it does not work if the new fragment and old fragment have the same XPath because hibernate executes the insert operations before the delete. Due to the execution order, DB throws a constraint error when trying to persist the data. 

      So, we need to change the implementation to delete the fragment only if the input does not have the same XPath and merge if XPath is the same.

      2. Concurrency issues: 

      Hibernate throws StaleStateException for a transaction when another has updated the same data in another transaction. 

      This issue is not avoidable and a proper error message should be sent to the user.



        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            renukumari Renu Kumari
            renukumari Renu Kumari
            0 Vote for this issue
            1 Start watching this issue