Ynt:postgresql : could not serialize access due to read/write dependencies among transactions

From: Neslisah Demirci <neslisah(dot)demirci(at)markafoni(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Ynt:postgresql : could not serialize access due to read/write dependencies among transactions
Date: 2017-01-18 05:41:54
Message-ID: AM5PR0501MB24337FD7FDB27CC04F666DFE9B7F0@AM5PR0501MB2433.eurprd05.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

________________________________
Gönderen: Neslisah Demirci
Gönderildi: 18 Ocak 2017 Çarşamba 08:36
Kime: John R Pierce
Konu: Ynt: [GENERAL] postgresql : could not serialize access due to read/write dependencies among transactions

We use ORM sequelize.js . My transactions are here ;

First I started conversation between two person ;

sql: 'INSERT INTO "XXXXX" ("id","customer","createdAt","updatedAt","CompanyId") VALUES (DEFAULT,\'905322653555\',\'2017-01-17 19:13:37.751 +00:00\',\'2017-01-17 19:13:37.751 +00:00\',\'1\') RETURNING *;' },

name: 'error', length: 274, severity: 'ERROR', code: '40001', detail: 'Reason code: Canceled on identification as a pivot, during write.', hint: 'The transaction might succeed if retried.', position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'predicate.c', line: '4605', routine: 'OnConflict_CheckForSerializationFailure',

Secondly ; i inserted messages as below;

Begin;

'INSERT INTO "YYYYY" ("id","body","from","to","state","data","xId","createdAt","updatedAt","CompanyId","MessageTypeId","ConvId") VALUES (DEFAULT,\'messagetext\',\'905309788255\',\'905309788200\',\'customer\',NULL,\'463DA712296218E0D4\',\'2017-01-17 06:43:19.228 +00:00\',\'2017-01-17 06:43:19.228 +00:00\',\'1\',1,23286) RETURNING *;'

commit;

original: { error: could not serialize access due to read/write dependencies among transactions at Connection.parseE (/app/node_modules/pg/lib/connection.js:554:11) at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:381:17) at Socket.<anonymous> (/app/

Best regards ,

Neslişah Demirci |Database Administrator

Ayazağa cad. No:4 Uniq İstanbul Plaza
B2 /Kat:3 34396 Ayazağa-SARIYER-İstanbul
T. (+90) 212 453 16 00 - 5516
F. (+90) 212 453 16 16
www.markafoni.com<http://www.markafoni.com/>
www.facebook.com/markafoni<http://www.facebook.com/markafoni>
blog.markafoni.com

________________________________
Gönderen: John R Pierce <pierce(at)hogranch(dot)com> adına pgsql-general-owner(at)postgresql(dot)org <pgsql-general-owner(at)postgresql(dot)org>
Gönderildi: 18 Ocak 2017 Çarşamba 08:10
Kime: pgsql-general(at)postgresql(dot)org
Konu: Re: [GENERAL] postgresql : could not serialize access due to read/write dependencies among transactions

On 1/17/2017 8:54 PM, Neslisah Demirci wrote:

could not serialize access due to read/write dependencies among transactions

only way to answer this would be to know what the various concurrent transactions are doing.

A message app like whatsapp i decided to use isolation level serializable if i use other transaction levels many conversations started with same number (think about whatsapp web sidebar multipling with same number every message).

again, we'd need to know what your transactions are doing. what you're describing sounds inherently incorrect, like you're doing too much in the application and not enough in the database

I also add an index to my query and my query's execution plan don't use seq scan .

that has no bearing on the above problems.

--
john r pierce, recycling bits in santa cruz

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-01-18 06:33:36 Re: Ynt:postgresql : could not serialize access due to read/write dependencies among transactions
Previous Message John R Pierce 2017-01-18 05:10:27 Re: postgresql : could not serialize access due to read/write dependencies among transactions