Postgresql Deadlock - what does “while rechecking updated tuple” mean?Deadlock during Slony uninstall and...
What is the difference between crontab -e and nano /etc/crontab?
How can I portray body horror and still be sensitive to people with disabilities?
Sauna: Wood does not feel so hot
Why do we divide Permutations to get to Combinations?
Rudeness by being polite
In a world with multiracial creatures, what word can be used instead of mankind?
Which was the first story to feature space elevators?
Taking an academic pseudonym?
Why don't reads from /dev/zero count as I/O?
Ramanujan's radical and how we define an infinite nested radical
Stream.findFirst different than Optional.of?
How to encircle section of matrix in LaTeX?
Why is quixotic not Quixotic (a proper adjective)?
Cryptic cross... with words
Why are `&array` and `array` pointing to the same address?
Exploding Numbers
The Longest Chess Game
Is it ethical to apply for a job on someone's behalf?
Is layered encryption more secure than long passwords?
Microphone on Mars
Why is Bernie Sanders maximum accepted donation on actblue $5600?
What dissuades people from lying about where they live in order to reduce state income taxes?
Short story where Earth is given a racist governor who likes species of a certain color
Found a major flaw in paper from home university – to which I would like to return
Postgresql Deadlock - what does “while rechecking updated tuple” mean?
Deadlock during Slony uninstall and concurrent access of DBCannot fetch the rowset from OLE DB provider “SQLNCLI” for linked server Xhow to avoid deadlock while updating 2 rows in mysqlSQL Server: deadlocked on lock communication buffer resourcesSingle DELETE statement deadlocking in Sybase ASEDeadlock detected on CREATE TABLE in PostgreSQLSimultaneous calls to the same function: how are deadlocks occurring?Why does Deadlock occur for this INSERT/UPDATE combination despite seemingly holding an X lock?What kind of deadlock the deadlock_timeout config parameter detects in Postgresql?Deadlock with two update queries
Question: Can someone please decipher while rechecking updated tuple
for me?
ERROR: deadlock detected
DETAIL:
Process 31391 waits for ShareLock on transaction 770573675; blocked by process 25788.
Process 25788 waits for ShareLock on transaction 770573695; blocked by process 31391.
Process 31391: update my_table row_to_update set col_to_update = now() from (select id from my_table where col_to_update is null order by id limit $4 for no key update) matched_row_to_update where row_to_update.id = matched_row_to_update.id returning row_to_update.id as id, row_to_update.col_to_update as col_to_update, row_to_update.other_col as other_col
Process 25788: update my_table set col_to_update=$1 other_col=$2 where id=$3
HINT: See server log for query details.
CONTEXT: while rechecking updated tuple (36328,33) in relation "my_table"
I found the it here but couldn't figure it out what exactly is happening there. what is the lock? and how can I debug/resolve it?
To be clear I understand what a deadlock is. I'm asking, based on the error message what is happening, or very simply what the error message means. For example, https://bit.ly/2TaWh6c or https://bit.ly/2Sk0lg0 or https://bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
A little background:
previously we had deadlock errors with the message: while updating tuple (xxx,xxx) in relation my_table
between the two transaction with the same query (the first query in the above). We managed to solve it by adding order by id for no key update
. But now, it's a new deadlock which I can't resolve.
postgresql deadlock
New contributor
add a comment |
Question: Can someone please decipher while rechecking updated tuple
for me?
ERROR: deadlock detected
DETAIL:
Process 31391 waits for ShareLock on transaction 770573675; blocked by process 25788.
Process 25788 waits for ShareLock on transaction 770573695; blocked by process 31391.
Process 31391: update my_table row_to_update set col_to_update = now() from (select id from my_table where col_to_update is null order by id limit $4 for no key update) matched_row_to_update where row_to_update.id = matched_row_to_update.id returning row_to_update.id as id, row_to_update.col_to_update as col_to_update, row_to_update.other_col as other_col
Process 25788: update my_table set col_to_update=$1 other_col=$2 where id=$3
HINT: See server log for query details.
CONTEXT: while rechecking updated tuple (36328,33) in relation "my_table"
I found the it here but couldn't figure it out what exactly is happening there. what is the lock? and how can I debug/resolve it?
To be clear I understand what a deadlock is. I'm asking, based on the error message what is happening, or very simply what the error message means. For example, https://bit.ly/2TaWh6c or https://bit.ly/2Sk0lg0 or https://bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
A little background:
previously we had deadlock errors with the message: while updating tuple (xxx,xxx) in relation my_table
between the two transaction with the same query (the first query in the above). We managed to solve it by adding order by id for no key update
. But now, it's a new deadlock which I can't resolve.
postgresql deadlock
New contributor
You should just catch the error and retry the transaction, at the application/framework/abstraction layer. Anything else could be an endless game of whack-a-mole. If you want to play the whack-a-mole game, then what do you see in the server log file about the other transactions involved in this deadlock?
– jjanes
1 min ago
add a comment |
Question: Can someone please decipher while rechecking updated tuple
for me?
ERROR: deadlock detected
DETAIL:
Process 31391 waits for ShareLock on transaction 770573675; blocked by process 25788.
Process 25788 waits for ShareLock on transaction 770573695; blocked by process 31391.
Process 31391: update my_table row_to_update set col_to_update = now() from (select id from my_table where col_to_update is null order by id limit $4 for no key update) matched_row_to_update where row_to_update.id = matched_row_to_update.id returning row_to_update.id as id, row_to_update.col_to_update as col_to_update, row_to_update.other_col as other_col
Process 25788: update my_table set col_to_update=$1 other_col=$2 where id=$3
HINT: See server log for query details.
CONTEXT: while rechecking updated tuple (36328,33) in relation "my_table"
I found the it here but couldn't figure it out what exactly is happening there. what is the lock? and how can I debug/resolve it?
To be clear I understand what a deadlock is. I'm asking, based on the error message what is happening, or very simply what the error message means. For example, https://bit.ly/2TaWh6c or https://bit.ly/2Sk0lg0 or https://bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
A little background:
previously we had deadlock errors with the message: while updating tuple (xxx,xxx) in relation my_table
between the two transaction with the same query (the first query in the above). We managed to solve it by adding order by id for no key update
. But now, it's a new deadlock which I can't resolve.
postgresql deadlock
New contributor
Question: Can someone please decipher while rechecking updated tuple
for me?
ERROR: deadlock detected
DETAIL:
Process 31391 waits for ShareLock on transaction 770573675; blocked by process 25788.
Process 25788 waits for ShareLock on transaction 770573695; blocked by process 31391.
Process 31391: update my_table row_to_update set col_to_update = now() from (select id from my_table where col_to_update is null order by id limit $4 for no key update) matched_row_to_update where row_to_update.id = matched_row_to_update.id returning row_to_update.id as id, row_to_update.col_to_update as col_to_update, row_to_update.other_col as other_col
Process 25788: update my_table set col_to_update=$1 other_col=$2 where id=$3
HINT: See server log for query details.
CONTEXT: while rechecking updated tuple (36328,33) in relation "my_table"
I found the it here but couldn't figure it out what exactly is happening there. what is the lock? and how can I debug/resolve it?
To be clear I understand what a deadlock is. I'm asking, based on the error message what is happening, or very simply what the error message means. For example, https://bit.ly/2TaWh6c or https://bit.ly/2Sk0lg0 or https://bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
A little background:
previously we had deadlock errors with the message: while updating tuple (xxx,xxx) in relation my_table
between the two transaction with the same query (the first query in the above). We managed to solve it by adding order by id for no key update
. But now, it's a new deadlock which I can't resolve.
postgresql deadlock
postgresql deadlock
New contributor
New contributor
edited 2 hours ago
Rad
New contributor
asked 6 hours ago
RadRad
1064
1064
New contributor
New contributor
You should just catch the error and retry the transaction, at the application/framework/abstraction layer. Anything else could be an endless game of whack-a-mole. If you want to play the whack-a-mole game, then what do you see in the server log file about the other transactions involved in this deadlock?
– jjanes
1 min ago
add a comment |
You should just catch the error and retry the transaction, at the application/framework/abstraction layer. Anything else could be an endless game of whack-a-mole. If you want to play the whack-a-mole game, then what do you see in the server log file about the other transactions involved in this deadlock?
– jjanes
1 min ago
You should just catch the error and retry the transaction, at the application/framework/abstraction layer. Anything else could be an endless game of whack-a-mole. If you want to play the whack-a-mole game, then what do you see in the server log file about the other transactions involved in this deadlock?
– jjanes
1 min ago
You should just catch the error and retry the transaction, at the application/framework/abstraction layer. Anything else could be an endless game of whack-a-mole. If you want to play the whack-a-mole game, then what do you see in the server log file about the other transactions involved in this deadlock?
– jjanes
1 min ago
add a comment |
1 Answer
1
active
oldest
votes
I assume you understand what a deadlock is. If you don't, you'll find more informations here and here.
It's particularly difficult for a human brain to imagine concurrency in data writing/reading (as real time programmation is difficult for a human brain). So you should consider applying these two simple rules in your application for DML:
- Always write data in the same order in your transactions
- Keep your transactions short (the shortest you can)
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Rad is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230357%2fpostgresql-deadlock-what-does-while-rechecking-updated-tuple-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I assume you understand what a deadlock is. If you don't, you'll find more informations here and here.
It's particularly difficult for a human brain to imagine concurrency in data writing/reading (as real time programmation is difficult for a human brain). So you should consider applying these two simple rules in your application for DML:
- Always write data in the same order in your transactions
- Keep your transactions short (the shortest you can)
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
add a comment |
I assume you understand what a deadlock is. If you don't, you'll find more informations here and here.
It's particularly difficult for a human brain to imagine concurrency in data writing/reading (as real time programmation is difficult for a human brain). So you should consider applying these two simple rules in your application for DML:
- Always write data in the same order in your transactions
- Keep your transactions short (the shortest you can)
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
add a comment |
I assume you understand what a deadlock is. If you don't, you'll find more informations here and here.
It's particularly difficult for a human brain to imagine concurrency in data writing/reading (as real time programmation is difficult for a human brain). So you should consider applying these two simple rules in your application for DML:
- Always write data in the same order in your transactions
- Keep your transactions short (the shortest you can)
I assume you understand what a deadlock is. If you don't, you'll find more informations here and here.
It's particularly difficult for a human brain to imagine concurrency in data writing/reading (as real time programmation is difficult for a human brain). So you should consider applying these two simple rules in your application for DML:
- Always write data in the same order in your transactions
- Keep your transactions short (the shortest you can)
answered 5 hours ago
ArkhenaArkhena
84918
84918
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
add a comment |
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
Thanks for the answer. Yes I understand what a deadlock is. I'm asking based on the error message what is happening, or very simply what the error message means. For example, bit.ly/2TaWh6c or bit.ly/2Sk0lg0 or bit.ly/2E2v9g9 describe different situations with different error message. But I couldn't find anything about the error I'm getting.
– Rad
3 hours ago
add a comment |
Rad is a new contributor. Be nice, and check out our Code of Conduct.
Rad is a new contributor. Be nice, and check out our Code of Conduct.
Rad is a new contributor. Be nice, and check out our Code of Conduct.
Rad is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230357%2fpostgresql-deadlock-what-does-while-rechecking-updated-tuple-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You should just catch the error and retry the transaction, at the application/framework/abstraction layer. Anything else could be an endless game of whack-a-mole. If you want to play the whack-a-mole game, then what do you see in the server log file about the other transactions involved in this deadlock?
– jjanes
1 min ago