Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L Legal
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Open Subsurface Data Universe SoftwareOpen Subsurface Data Universe Software
  • Platform
  • Security and Compliance
  • Legal
  • Merge requests
  • !74

use createItem instead of upsertItem for create api

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alok Joshi requested to merge use_create_item into master Nov 06, 2020
  • Overview 1
  • Commits 6
  • Pipelines 12
  • Changes 3

Use createItem instead of upsertItem when creating a legal tag. This prevents concurrent creation of the same legaltag which was being an issue with a particular integration test (should_onlyLetAMaximumOf1LegaltagBeCreated_when_tryingToCreateMultipleVersionsOfTheSameContractAtTheSameTime). The root cause of failure of this integration test was concurrency: after the recent scaling change, multiple service instances try to create the same legaltag at the same time and more than 1 instances succeed. The reason is two folds: Legal uses upsertItem instead of createItem function to create the legal tag, which allows create and updates on the data in cosmos; the second reason being we are using instance based locking which won't work in a distributed (multi instance) scenario.

We also don't need the explicit lock inside create() method now because we use createItem, which inherently doesn't allow creation of the same object if it exists in the cosmos db.

Removed a duplicate dependency declaration from pom.

Edited Nov 10, 2020 by Alok Joshi
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: use_create_item