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

error: cannot delete from table "archive" because it does not have a replica identity and publishes deletes #387

Open
mikecann opened this issue Apr 30, 2023 · 2 comments

Comments

@mikecann
Copy link

Hi,

Im experimenting around with pg-boss as a replacement for our redis based queue and am getting the following error periodically:

[web] [error] [ErrorsService] error: cannot delete from table "archive" because it does not have a replica identity and publishes deletes
[web]     at Parser.parseErrorMessage (C:\dev\gangbusters\battletabs\node_modules\pg-protocol\dist\parser.js:287:98)
[web]     at Parser.handlePacket (C:\dev\gangbusters\battletabs\node_modules\pg-protocol\dist\parser.js:126:29)
[web]     at Parser.parse (C:\dev\gangbusters\battletabs\node_modules\pg-protocol\dist\parser.js:39:38)
[web]     at Socket.<anonymous> (C:\dev\gangbusters\battletabs\node_modules\pg-protocol\dist\index.js:11:42)
[web]     at Socket.emit (node:events:513:28)
[web]     at addChunk (node:internal/streams/readable:324:12)
[web]     at readableAddChunk (node:internal/streams/readable:297:9)
[web]     at Readable.push (node:internal/streams/readable:234:10)
[web]     at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
[web]     at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
[web]   length: 253,
[web]   severity: 'ERROR',
[web]   code: '55000',
[web]   detail: undefined,
[web]   hint: 'To enable deleting from the table, set REPLICA IDENTITY using ALTER TABLE.',
[web]   position: undefined,
[web]   internalPosition: undefined,
[web]   internalQuery: undefined,
[web]   where: undefined,
[web]   schema: undefined,
[web]   table: undefined,
[web]   column: undefined,
[web]   dataType: undefined,
[web]   constraint: undefined,
[web]   file: 'execReplication.c',
[web]   line: '581',
[web]   routine: 'CheckCmdReplicaIdentity'
[web] }

Im assuming this is happening on a schedule as part of some maintenance job PGBoss is doing but im not sure what it is in my DB that might be causing it.

Any ideas?

@mikecann
Copy link
Author

mikecann commented Apr 30, 2023

Looks like it was due to the WAL replication slots I was also experimenting around with.

I have now deleted those slots and the error no longer shows.

There may however be a better way of handling this?

Nope, its still happening.. :(

@timgit
Copy link
Owner

timgit commented May 9, 2023

This is happening because the archive table doesn't have a primary key defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants