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

Concurrency Conflicts Exception string "!transaction is aborted because of concurrency conflicts, will ROLLBACK instead" not shown on prompt. #6662

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2018-11-23 08:58:01 +0100
From: Arshad <<arshad.super>>
To: MonetDB5 devs <>
Version: 11.31.11 (Aug2018-SP1)

Last updated: 2019-01-16 11:17:09 +0100

Comment 26696

Date: 2018-11-23 08:58:01 +0100
From: Arshad <<arshad.super>>

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:

Hello Monetdb Devs!,

We are planning to move from monetdb version 'v11.27.13 "Jul2017-SP4" (64-bit)' to latest 'v11.31.11 "Aug2018-SP1" (64-bit, 128-bit integers)'. Although this should be straight forward. The obstruction we are facing is that our script is relying on "ROLLBACK" exception string to figure out if conflicts had happened. If yes, they would retry the operation after waiting / sleeping for some seconds. Something in the lines of (

However with the version of monetdb-11.31.11, the exception 'ROLLBACK' string was not seen to on the prompt. This was resulting in script not being able to determin if there is a "concurrency conflicts" at all.

We debuged and found out that the exception was correctly propagated, it seems that the flush on buffer was not happening. After forcing a flush of an exception buffer message, only for rollback we are observing the string is appearing on the prompt. The below changes once ran against our simple test case spits out "Rollback" exception string on prompt as expected.

1 affected row 1 affected row 1 affected row 1 affected row 1 affected row COMMIT: transaction is aborted because of concurrency conflicts, will ROLLBACK instead DROP TABLE: no such table 'test2' operation successful

Could you please adivce why could the "ROLLBACK" excetion not show on prompt and if this fix is on the correct direction.

Attached repo.tar as reproducer.



  • The code. We would most definitely bullet-proof the
  • needle to trap the exact excetipon, for now this works
  • for our POC

--- monetdb5/mal/mal_session_ori.c 2018-11-21 06:01:51.412446566 -0500
+++ monetdb5/mal/mal_session.c 2018-11-19 12:03:16.715752671 -0500
@@ -680,6 +680,7 @@
/* don't print exception decoration, just the message */
char *n = NULL;
char *o = msg;

  •           char *needle = "ROLLBACK";
              while ((n = strchr(o, '\n')) != NULL) {
                      if (*o == '!')

@@ -691,6 +692,8 @@
if (*o == '!')
mnstr_printf(c->fdout, "!%s\n", o);

  •                   if (strstr(o, needle))
  •                           mnstr_flush(c->fdout);

System Details

/root/monet1131/bin/mserver5 --version
MonetDB 5 server v11.31.11 "Aug2018-SP1" (64-bit, 128-bit integers)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit for further information
Found 1.8GiB available memory, 1 available cpu core
libpcre: 8.32 2012-11-30 (compiled with 8.32)
openssl: OpenSSL 1.0.2k 26 Jan 2017 (compiled with OpenSSL 1.0.2k-fips 26 Jan 2017)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: (x86_64-pc-linux-gnu)
Compilation: gcc -std=gnu99 -g -O2
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions

uname -a
Linux 3.10.0-862.9.1.el7_lustre.x86_64 1 SMP Mon Aug 27 17:48:12 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

cat config.log | grep -v define | grep VERSION

Reproducible: Always

Steps to Reproduce:

  1. tar -xvf repo.tar Extract reporducer
  2. bash ./ Run the test

Actual Results:

Exception string of ROLLBACK not seen.

Expected Results:

Exception string of ROLLBACK should be shown.

1 affected row
1 affected row
1 affected row
1 affected row
1 affected row
COMMIT: transaction is aborted because of concurrency conflicts, will ROLLBACK instead
DROP TABLE: no such table 'test2'
operation successful

Comment 26697

Date: 2018-11-23 10:29:39 +0100
From: Arshad <<arshad.super>>

Created attachment 610
Reproducer script

Attached file: repo.tar (application/octet-stream, 972800 bytes)
Description: Reproducer script

Comment 26698

Date: 2018-11-27 17:38:46 +0100
From: Arshad <<arshad.super>>


Any update on this bug?


Comment 26718

Date: 2018-12-11 11:38:01 +0100
From: MonetDB Mercurial Repository <>

Changeset a53f4d178d47 made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a53f4d178d47

Changeset description:

When closing a stream, first flush.
This fixes bug #6662.

Comment 26722

Date: 2018-12-12 03:58:19 +0100
From: Arshad <<arshad.super>>

Thanks Sjoerd!

I will try out the fix against our script and will update.

Comment 26797

Date: 2019-01-16 11:17:09 +0100
From: Arshad <<arshad.super>>

Verified with Aug2018-SP2.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant