Question
· Nov 8, 2016

2 Skipping SET due to compare and swap failed on - in CConsole Log

Hi Everyone,

         I have frequently received this below error message in my ensemble 2009 Cconsole log.

         " 11/08-13:05:06:114 (9784) 2 Skipping SET due to compare and swap failed on ^["^^e:\test\data\"]Debug("CalcTotal1") for records in e:\test\data\ addr=39745548 "

        Please explain this, am very much trouble with this alert. And also want to know it will cause any system hangsup ?

please response quickly. Thanks

Archunan K.

Discussion (5)0
Log in or sign up to continue

This message is logged in cconsole.log (and alerts.log) when, during a transaction rollback, Cache finds a global node with an unexpected value, different from the value it had when the transaction started. The process keeps the unexpected value and logs the message. And your system won't hang because of that.

The following commands can be used to produce the case:

USER>s ^mytest = "before transaction"
USER>tstart
TL1:USER>k ^mytest
TL1:USER>s ^mytest = "inside transaction"

In a separate terminal session, run set ^mytest = "separate terminal"

TL1:USER>trollback
USER>w ^mytest
​separate terminal

cconsole.log

02/22/11-13:09:09:250 (4832) 2 Skipping SET (kill) due to compare and swap failed on
^["^^d:\isc\c2010_2_0_454_0\mgr\user\"]mytest for records in d:\isc\c2010_2_0_454_0\mgr\user\
addr=158748
02/22/11-13:09:09:250 (4832) 2 Skipping KILL due to global
^["^^d:\isc\c2010_2_0_454_0\mgr\user\"]mytest already exist for records in
d:\isc\c2010_2_0_454_0\mgr\user\
addr=158352

Aline has a good description of why this happens.  I wanted to say what it means, in case the effects are not obvious.  

This error means that your database isn't transactionally consistent.  Transactions have several properties.  One is that  either none or all of their updates will happen.  Another is that no one will be able to see a situation where some, but not all, of the updates have been completed.  This error is saying that a process was able to change part of these updates while the transaction was being worked on, and therefore we weren't able to safely return to having none of the updates happen.  

 To put this in an example:  pretend you're doing a bank transfer.  You're taking $100 from account A and putting it in account B.  You don't want the $100 to disappear (be removed from A and not added to B) or an extra $100 to be generated (not be removed from A and be added to B.)  This error is saying that one of those situations where money was created or destroyed probably happened.

To prevent this in the future, you'd want to look into whether there are missing locks in the code the processes involved are running.