Forum Discussion

MalcolmMcDonald's avatar
MalcolmMcDonald
Qrew Cadet
4 years ago

Data Race Conditions

In a QB Channel -- I seem to be experiencing a race condition

From a staging table:
1. [Thread 1] System checks to see if order A exists in the sales table. Does not find Order A

2. [Thread 2] System checks to see if order A exists in the sales table. Does not find Order A
3. System creates Order A
4. System creates Order A

Where what should be happening is step 3 moves up to step 2.  

Any ideas on throttling or flagging? 


------------------------------
Malcolm McDonald
------------------------------
  • Is the situation that you are mass creating or importing children and you want to make Parents when required?  Is the parent getting duplicated? can there be a custom Key field for the parent so it can't get duplicated?  ie does the trigger know what the Key field of the Parent Order should be?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • MalcolmMcDonald's avatar
      MalcolmMcDonald
      Qrew Cadet
      Hi Mark - thanks for looking at this!

      A sample of data looks like this:
      OrderID Date Status Product
      73906 19-Mar-21 10:19:55 RESERVED 123 Hat
      73906 21-Mar-21 4:08:22 COMPLETED 123 Hat

      In one csv file, I'll have the order's state progression.  Using a QB Record Create trigger pipeline on a staging table - writing to a Sales table.

      After the file has been processed through the pipeline, I might have one record in the Sales table or two - it's seemingly random. It seems like a classic data race - https://devopedia.org/race-condition-software but I haven't been able to sort out QB's handling for it. Has anyone else seen it?


      ------------------------------
      Malcolm McDonald
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        You have not really described what the pipeline is doing but I believe they do run in parallel. So for example if the pipeline is potentially triggered by every record being processed in a CSV file then to pipelines may be running simultaneously, unaware of each other.

        Can you explain what the pipeline is supposed to do?

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------