Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-42

Preventing Data loss from Temporarily tables

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0
    • Component/s: Data Management
    • Labels:
      None
    • Additional information:
      Hide

      Implementing logic:
      Add new Semaphores table, that will consist of Timestamp, SessionKey and MainPrefix columns. Before temp to live coping starts open second database connection and lock Semaphores table (new table). Then we should search for any record for our prefix. When found we release lock, wait for 1 second and repeat previous steps. In case, when we totally have waited for 30 seconds, then exit from coping process with error.

      If at some point we haven't found record with our prefix, then we should add one and release lock. Perform coping from temp to live. Lock Semaphores table and delete our previously added record and release lock.

      This way if two (or more) temp handlers will meet, then they will wait for each other and won't start to work concurrently.

      Show
      Implementing logic: Add new Semaphores table, that will consist of Timestamp, SessionKey and MainPrefix columns. Before temp to live coping starts open second database connection and lock Semaphores table (new table). Then we should search for any record for our prefix. When found we release lock, wait for 1 second and repeat previous steps. In case, when we totally have waited for 30 seconds, then exit from coping process with error. If at some point we haven't found record with our prefix, then we should add one and release lock. Perform coping from temp to live. Lock Semaphores table and delete our previously added record and release lock. This way if two (or more) temp handlers will meet, then they will wait for each other and won't start to work concurrently.
    • External issue ID:
      52
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      We could lost data, when 2 concurrently running processes tries to copy data from same temporary table to live table. To prevent this I propose to implement semaphore system. Idea is to put all processes, that required temp->live operation to queue using database lock feature.

      Preventing Data loss from Temporarily tables

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: