Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change psql concurrency from autocommit to serializable. #1190

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Change psql concurrency from autocommit to serializable. #1190

wants to merge 2 commits into from

Commits on May 29, 2018

  1. Change psql concurrency from autocommit to serializable.

    Autocommit is giving concurrency errors in PostgreSQL when operations
    are sent in parallel. Using serializable transactions seems to fix it.
    
    For ex:
    
    ERROR:  deadlock detected
    DETAIL:  Process 176184 waits for ShareLock on transaction 15529683; blocked by process 191002.
     Process 191002 waits for ShareLock on transaction 15529684; blocked by process 178678.
     Process 178678 waits for ExclusiveLock on tuple (1386,16) of relation 43815 of database 16391; blocked by process 176184.
     Process 176184: DELETE FROM ip_net_plan AS p WHERE vrf_id = 0 AND prefix = '10.0.10.240/28'
     Process 191002: DELETE FROM ip_net_plan AS p WHERE vrf_id = 0 AND prefix = '10.0.11.0/28'
     Process 178678: DELETE FROM ip_net_plan AS p WHERE vrf_id = 0 AND prefix = '10.0.10.208/28'
    HINT:  See server log for query details.
    CONTEXT:  while locking tuple (1386,16) in relation "ip_net_plan"
     SQL statement "UPDATE ip_net_plan SET children =
          (SELECT COUNT(1)
          FROM ip_net_plan
          WHERE vrf_id = OLD.vrf_id
           AND iprange(prefix) << iprange(old_parent.prefix)
           AND indent = old_parent.indent+1)
         WHERE id = old_parent.id"
     PL/pgSQL function tf_ip_net_plan__prefix_iu_after() line 92 at SQL statement
    STATEMENT:  DELETE FROM ip_net_plan AS p WHERE vrf_id = 0 AND prefix = '10.0.10.240/28'
    acceso committed May 29, 2018
    Configuration menu
    Copy the full SHA
    0dabd59 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2018

  1. Configuration menu
    Copy the full SHA
    f2554dd View commit details
    Browse the repository at this point in the history