@@ -154,10 +154,10 @@ find_pkey_tuple(ScanKey skey, Relation rel, Relation idxrel,
154
154
/* XXX: Improve handling here */
155
155
ereport (LOG ,
156
156
(errcode (ERRCODE_T_R_SERIALIZATION_FAILURE ),
157
- errmsg ("concurrent update, retrying" )));
157
+ MTM_ERRMSG ("concurrent update, retrying" )));
158
158
goto retry ;
159
159
default :
160
- elog (ERROR , "unexpected HTSU_Result after locking: %u" , res );
160
+ MTM_ELOG (ERROR , "unexpected HTSU_Result after locking: %u" , res );
161
161
break ;
162
162
}
163
163
}
@@ -253,7 +253,7 @@ build_index_scan_key(ScanKey skey, Relation rel, Relation idxrel, TupleData *tup
253
253
BTEqualStrategyNumber );
254
254
255
255
if (!OidIsValid (operator ))
256
- elog (ERROR ,
256
+ MTM_ELOG (ERROR ,
257
257
"could not lookup equality operator for type %u, optype %u in opfamily %u" ,
258
258
atttype , optype , opfamily );
259
259
@@ -305,7 +305,7 @@ UserTableUpdateOpenIndexes(EState *estate, TupleTableSlot *slot)
305
305
if (recheckIndexes != NIL )
306
306
ereport (ERROR ,
307
307
(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
308
- errmsg ("bdr doesn't support index rechecks" )));
308
+ MTM_ERRMSG ("bdr doesn't support index rechecks" )));
309
309
}
310
310
311
311
/* FIXME: recheck the indexes */
@@ -359,7 +359,7 @@ process_remote_begin(StringInfo s)
359
359
rc = SPI_execute ("RESET SESSION AUTHORIZATION; reset all;" , false, 0 );
360
360
SPI_finish ();
361
361
if (rc < 0 ) {
362
- elog (ERROR , "Failed to set reset context: %d" , rc );
362
+ MTM_ELOG (ERROR , "Failed to set reset context: %d" , rc );
363
363
}
364
364
}
365
365
@@ -398,7 +398,7 @@ process_remote_message(StringInfo s)
398
398
rc = SPI_execute (messageBody , false, 0 );
399
399
SPI_finish ();
400
400
if (rc < 0 ) {
401
- elog (ERROR , "Failed to execute utility statement %s" , messageBody );
401
+ MTM_ELOG (ERROR , "Failed to execute utility statement %s" , messageBody );
402
402
} else {
403
403
PushActiveSnapshot (GetTransactionSnapshot ());
404
404
@@ -483,15 +483,15 @@ read_tuple_parts(StringInfo s, Relation rel, TupleData *tup)
483
483
action = pq_getmsgbyte (s );
484
484
485
485
if (action != 'T' )
486
- elog (ERROR , "expected TUPLE, got %c" , action );
486
+ MTM_ELOG (ERROR , "expected TUPLE, got %c" , action );
487
487
488
488
memset (tup -> isnull , 1 , sizeof (tup -> isnull ));
489
489
memset (tup -> changed , 1 , sizeof (tup -> changed ));
490
490
491
491
rnatts = pq_getmsgint (s , 2 );
492
492
493
493
if (desc -> natts < rnatts )
494
- elog (ERROR , "tuple natts mismatch, %u vs %u" , desc -> natts , rnatts );
494
+ MTM_ELOG (ERROR , "tuple natts mismatch, %u vs %u" , desc -> natts , rnatts );
495
495
496
496
/* FIXME: unaligned data accesses */
497
497
@@ -555,7 +555,7 @@ read_tuple_parts(StringInfo s, Relation rel, TupleData *tup)
555
555
if (buf .len != buf .cursor )
556
556
ereport (ERROR ,
557
557
(errcode (ERRCODE_INVALID_BINARY_REPRESENTATION ),
558
- errmsg ("incorrect binary data format" )));
558
+ MTM_ERRMSG ("incorrect binary data format" )));
559
559
break ;
560
560
}
561
561
case 't' : /* text format */
@@ -574,11 +574,11 @@ read_tuple_parts(StringInfo s, Relation rel, TupleData *tup)
574
574
}
575
575
break ;
576
576
default :
577
- elog (ERROR , "unknown column type '%c'" , kind );
577
+ MTM_ELOG (ERROR , "unknown column type '%c'" , kind );
578
578
}
579
579
580
580
if (att -> attisdropped && !tup -> isnull [i ])
581
- elog (ERROR , "data for dropped column" );
581
+ MTM_ELOG (ERROR , "data for dropped column" );
582
582
}
583
583
}
584
584
@@ -703,7 +703,7 @@ process_remote_commit(StringInfo in)
703
703
MtmSetCurrentTransactionCSN (csn );
704
704
MtmSetCurrentTransactionGID (gid );
705
705
FinishPreparedTransaction (gid , true);
706
- MTM_LOG1 ("Distributed transaction %s is committed" , gid );
706
+ MTM_LOG2 ("Distributed transaction %s is committed" , gid );
707
707
CommitTransactionCommand ();
708
708
Assert (!MtmTransIsActive ());
709
709
MtmEndSession (origin_node , true);
@@ -755,7 +755,7 @@ process_remote_insert(StringInfo s, Relation rel)
755
755
}
756
756
757
757
// if (rel->rd_rel->relkind != RELKIND_RELATION) // RELKIND_MATVIEW
758
- // elog (ERROR, "unexpected relkind '%c' rel \"%s\"",
758
+ // MTM_ELOG (ERROR, "unexpected relkind '%c' rel \"%s\"",
759
759
// rel->rd_rel->relkind, RelationGetRelationName(rel));
760
760
761
761
/* debug output */
@@ -804,7 +804,7 @@ process_remote_insert(StringInfo s, Relation rel)
804
804
/* TODO: Report tuple identity in log */
805
805
ereport (ERROR ,
806
806
(errcode (ERRCODE_UNIQUE_VIOLATION ),
807
- errmsg ("Unique constraints violated by remotely INSERTed tuple" ),
807
+ MTM_ERRMSG ("Unique constraints violated by remotely INSERTed tuple" ),
808
808
errdetail ("Cannot apply transaction because remotely INSERTed tuple conflicts with a local tuple on UNIQUE constraint and/or PRIMARY KEY" )));
809
809
}
810
810
CHECK_FOR_INTERRUPTS ();
@@ -851,7 +851,7 @@ process_remote_update(StringInfo s, Relation rel)
851
851
852
852
/* old key present, identifying key changed */
853
853
if (action != 'K' && action != 'N' )
854
- elog (ERROR , "expected action 'N' or 'K', got %c" ,
854
+ MTM_ELOG (ERROR , "expected action 'N' or 'K', got %c" ,
855
855
action );
856
856
857
857
estate = create_rel_estate (rel );
@@ -871,11 +871,11 @@ process_remote_update(StringInfo s, Relation rel)
871
871
872
872
/* check for new tuple */
873
873
if (action != 'N' )
874
- elog (ERROR , "expected action 'N', got %c" ,
874
+ MTM_ELOG (ERROR , "expected action 'N', got %c" ,
875
875
action );
876
876
877
877
if (rel -> rd_rel -> relkind != RELKIND_RELATION )
878
- elog (ERROR , "unexpected relkind '%c' rel \"%s\"" ,
878
+ MTM_ELOG (ERROR , "unexpected relkind '%c' rel \"%s\"" ,
879
879
rel -> rd_rel -> relkind , RelationGetRelationName (rel ));
880
880
881
881
/* read new tuple */
@@ -887,7 +887,7 @@ process_remote_update(StringInfo s, Relation rel)
887
887
idxoid = rel -> rd_replidindex ;
888
888
if (!OidIsValid (idxoid ))
889
889
{
890
- elog (ERROR , "could not find primary key for table with oid %u" ,
890
+ MTM_ELOG (ERROR , "could not find primary key for table with oid %u" ,
891
891
RelationGetRelid (rel ));
892
892
return ;
893
893
}
@@ -936,7 +936,7 @@ process_remote_update(StringInfo s, Relation rel)
936
936
{
937
937
ereport (ERROR ,
938
938
(errcode (ERRCODE_NO_DATA_FOUND ),
939
- errmsg ("Record with specified key can not be located at this node" ),
939
+ MTM_ERRMSG ("Record with specified key can not be located at this node" ),
940
940
errdetail ("Most likely we have DELETE-UPDATE conflict" )));
941
941
942
942
}
@@ -976,7 +976,7 @@ process_remote_delete(StringInfo s, Relation rel)
976
976
idxoid = rel -> rd_replidindex ;
977
977
if (!OidIsValid (idxoid ))
978
978
{
979
- elog (ERROR , "could not find primary key for table with oid %u" ,
979
+ MTM_ELOG (ERROR , "could not find primary key for table with oid %u" ,
980
980
RelationGetRelid (rel ));
981
981
return ;
982
982
}
@@ -985,7 +985,7 @@ process_remote_delete(StringInfo s, Relation rel)
985
985
idxrel = index_open (idxoid , RowExclusiveLock );
986
986
987
987
if (rel -> rd_rel -> relkind != RELKIND_RELATION )
988
- elog (ERROR , "unexpected relkind '%c' rel \"%s\"" ,
988
+ MTM_ELOG (ERROR , "unexpected relkind '%c' rel \"%s\"" ,
989
989
rel -> rd_rel -> relkind , RelationGetRelationName (rel ));
990
990
991
991
#ifdef VERBOSE_DELETE
@@ -1013,7 +1013,7 @@ process_remote_delete(StringInfo s, Relation rel)
1013
1013
{
1014
1014
ereport (ERROR ,
1015
1015
(errcode (ERRCODE_NO_DATA_FOUND ),
1016
- errmsg ("Record with specified key can not be located at this node" ),
1016
+ MTM_ERRMSG ("Record with specified key can not be located at this node" ),
1017
1017
errdetail ("Most likely we have DELETE-DELETE conflict" )));
1018
1018
}
1019
1019
@@ -1127,7 +1127,7 @@ void MtmExecutor(void* work, size_t size)
1127
1127
break ;
1128
1128
}
1129
1129
default :
1130
- elog (ERROR , "unknown action of type %c" , action );
1130
+ MTM_ELOG (ERROR , "unknown action of type %c" , action );
1131
1131
}
1132
1132
break ;
1133
1133
}
0 commit comments