I see a lot of this in the postgres log for MAAS:
2017-07-06 12:26:44 BST [92158-1] maas@maasdb ERROR: could not serialize access due to concurrent update
2017-07-06 12:26:44 BST [92158-2] maas@maasdb STATEMENT: UPDATE "maasserver_node" SET "updated" = '2017-07-06T12:26:44.442947'::timestamp, "status_expires" = NULL WHERE "maasserver_node"."id" = 1
2017-07-06 12:26:45 BST [92165-1] maas@maasdb ERROR: could not serialize access due to concurrent update
2017-07-06 12:26:45 BST [92165-2] maas@maasdb STATEMENT: UPDATE "maasserver_staticipaddress" SET "created" = '2017-07-06T12:26:45'::timestamp, "updated" = '2017-07-06T12:26:45.597922'::timestamp, "ip" = '192.168.1.166'::inet, "alloc_type" = 6, "subnet_id" = 2, "user_id" = NULL, "lease_time" = 600 WHERE "maasserver_staticipaddress"."id" = 349572
What are we using the 'updated' field for in this table?
The timestamp updates causes considerable CPU load. By watching top and pg_stat_activity, I was able to catch PID 51544 in the act. The actions of the PID are:
root@infr002: /var/log/ postgresql# grep 51544 postgresql- 9.5-ha. log 28T01:19: 59.158232' ::timestamp, "status_expires" = NULL WHERE "maasserver_ node"." id" = 1 28T01:20: 13.954158' ::timestamp, "status_expires" = NULL WHERE "maasserver_ node"." id" = 1 28T01:20: 23.316807' ::timestamp, "status_expires" = NULL WHERE "maasserver_ node"." id" = 1 service" SET "updated" = '2019-01- 28T01:20: 33.513096' ::timestamp, "status_info" = '50% connected to region controllers.' WHERE "maasserver_ service" ."id" = 24 28T01:20: 47.634756' ::timestamp, "status_expires" = NULL WHERE "maasserver_ node"." id" = 1 service" SET "updated" = '2019-01- 28T01:20: 56.272271' ::timestamp, "status_info" = '33% connected to region controllers.' WHERE "maasserver_ service" ."id" = 29 process_ id" = NULL WHERE "maasserver_ node"." id" IN (3) process_ id" = NULL WHERE "maasserver_ node"." id" IN (3)
2019-01-28 01:20:13 UTC [51544-1] maas@maasdb ERROR: could not serialize access due to concurrent update
2019-01-28 01:20:13 UTC [51544-2] maas@maasdb STATEMENT: UPDATE "maasserver_node" SET "updated" = '2019-01-
2019-01-28 01:20:23 UTC [51544-3] maas@maasdb ERROR: could not serialize access due to concurrent update
2019-01-28 01:20:23 UTC [51544-4] maas@maasdb STATEMENT: UPDATE "maasserver_node" SET "updated" = '2019-01-
2019-01-28 01:20:33 UTC [51544-5] maas@maasdb ERROR: could not serialize access due to concurrent update
2019-01-28 01:20:33 UTC [51544-6] maas@maasdb STATEMENT: UPDATE "maasserver_node" SET "updated" = '2019-01-
2019-01-28 01:20:47 UTC [51544-7] maas@maasdb ERROR: could not serialize access due to concurrent update
2019-01-28 01:20:47 UTC [51544-8] maas@maasdb STATEMENT: UPDATE "maasserver_
2019-01-28 01:20:55 UTC [51544-9] maas@maasdb ERROR: could not serialize access due to concurrent update
2019-01-28 01:20:55 UTC [51544-10] maas@maasdb STATEMENT: UPDATE "maasserver_node" SET "updated" = '2019-01-
2019-01-28 01:21:43 UTC [51544-11] maas@maasdb ERROR: could not serialize access due to concurrent update
2019-01-28 01:21:43 UTC [51544-12] maas@maasdb STATEMENT: UPDATE "maasserver_
2019-01-28 01:23:45 UTC [52492-15] maas@maasdb DETAIL: Process 52492 waits for ShareLock on transaction 107337590; blocked by process 51544.
Process 51544 waits for ExclusiveLock on tuple (74745,15) of relation 16829 of database 16385; blocked by process 52486.
Process 51544: UPDATE "maasserver_node" SET "managing_
2019-01-28 01:24:04 UTC [52486-15] maas@maasdb DETAIL: Process 52486 waits for ShareLock on transaction 107337590; blocked by process 51544.
Process 51544 waits for ExclusiveLock on tuple (74745,15) of relation 16829 of database 16385; blocked by process 54211.
Process 51544: UPDATE "maasserver_node" SET "managing_
2019-01-28 01:24:30 UTC [52489-18] maas@maasdb DETAIL: Process 52489 waits for ShareLock on transaction 107337590; blocked by process 51544.
Process 51544 waits for ShareLock on transaction 107337670; blocked by process 52489.
Process 51544: UPDATE "maasserver_node" SET "managing_p...