提交 34971f37 编写于 作者: A Ashwin Agrawal

Get rm_desc signature and code closer to upstream.

Removing the Greenplum specific guc `Debug_xlog_insert_print`. Instead use
upstream guc `wal_debug` for the same. Also, remove some unneccessary
modifications vs upstream.
上级 14b79227
...@@ -769,13 +769,6 @@ static void SetCurrentChunkStartTime(TimestampTz xtime); ...@@ -769,13 +769,6 @@ static void SetCurrentChunkStartTime(TimestampTz xtime);
static int XLogFileReadAnyTLI(uint32 log, uint32 seg, int emode, int sources); static int XLogFileReadAnyTLI(uint32 log, uint32 seg, int emode, int sources);
static void XLogProcessCheckpointRecord(XLogRecord *rec, XLogRecPtr loc); static void XLogProcessCheckpointRecord(XLogRecord *rec, XLogRecPtr loc);
typedef struct RedoErrorCallBack
{
XLogRecPtr location;
XLogRecord *record;
} RedoErrorCallBack;
void HandleStartupProcInterrupts(void); void HandleStartupProcInterrupts(void);
static void GetXLogCleanUpTo(XLogRecPtr recptr, uint32 *_logId, uint32 *_logSeg); static void GetXLogCleanUpTo(XLogRecPtr recptr, uint32 *_logId, uint32 *_logSeg);
...@@ -1257,7 +1250,8 @@ begin:; ...@@ -1257,7 +1250,8 @@ begin:;
Insert->currpos += SizeOfXLogRecord; Insert->currpos += SizeOfXLogRecord;
freespace -= SizeOfXLogRecord; freespace -= SizeOfXLogRecord;
if (Debug_xlog_insert_print) #ifdef WAL_DEBUG
if (XLOG_DEBUG)
{ {
StringInfoData buf; StringInfoData buf;
char *contiguousCopy; char *contiguousCopy;
...@@ -1277,6 +1271,7 @@ begin:; ...@@ -1277,6 +1271,7 @@ begin:;
elog(LOG, "%s", buf.data); elog(LOG, "%s", buf.data);
pfree(buf.data); pfree(buf.data);
} }
#endif
/* /*
* Append the data, including backup blocks if any * Append the data, including backup blocks if any
...@@ -6398,16 +6393,12 @@ ApplyStartupRedo( ...@@ -6398,16 +6393,12 @@ ApplyStartupRedo(
{ {
/* use volatile pointer to prevent code rearrangement */ /* use volatile pointer to prevent code rearrangement */
volatile XLogCtlData *xlogctl = XLogCtl; volatile XLogCtlData *xlogctl = XLogCtl;
RedoErrorCallBack redoErrorCallBack;
ErrorContextCallback errcontext; ErrorContextCallback errcontext;
/* Setup error traceback support for ereport() */ /* Setup error traceback support for ereport() */
redoErrorCallBack.location = *beginLoc;
redoErrorCallBack.record = record;
errcontext.callback = rm_redo_error_callback; errcontext.callback = rm_redo_error_callback;
errcontext.arg = (void *) &redoErrorCallBack; errcontext.arg = (void *) record;
errcontext.previous = error_context_stack; errcontext.previous = error_context_stack;
error_context_stack = &errcontext; error_context_stack = &errcontext;
...@@ -7292,8 +7283,6 @@ StartupXLOG(void) ...@@ -7292,8 +7283,6 @@ StartupXLOG(void)
*/ */
do do
{ {
// GPDB_91_MERGE_FIXME
#if 0
#ifdef WAL_DEBUG #ifdef WAL_DEBUG
if (XLOG_DEBUG || if (XLOG_DEBUG ||
(rmid == RM_XACT_ID && trace_recovery_messages <= DEBUG2) || (rmid == RM_XACT_ID && trace_recovery_messages <= DEBUG2) ||
...@@ -7307,12 +7296,10 @@ StartupXLOG(void) ...@@ -7307,12 +7296,10 @@ StartupXLOG(void)
EndRecPtr.xlogid, EndRecPtr.xrecoff); EndRecPtr.xlogid, EndRecPtr.xrecoff);
xlog_outrec(&buf, record); xlog_outrec(&buf, record);
appendStringInfo(&buf, " - "); appendStringInfo(&buf, " - ");
RmgrTable[record->xl_rmid].rm_desc(&buf, RmgrTable[record->xl_rmid].rm_desc(&buf, record);
XLogRecGetData(record));
elog(LOG, "%s", buf.data); elog(LOG, "%s", buf.data);
pfree(buf.data); pfree(buf.data);
} }
#endif
#endif #endif
/* Handle interrupt signals of startup process */ /* Handle interrupt signals of startup process */
HandleStartupProcInterrupts(); HandleStartupProcInterrupts();
...@@ -11453,13 +11440,11 @@ read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired) ...@@ -11453,13 +11440,11 @@ read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired)
static void static void
rm_redo_error_callback(void *arg) rm_redo_error_callback(void *arg)
{ {
RedoErrorCallBack *redoErrorCallBack = (RedoErrorCallBack*) arg; XLogRecord *record = (XLogRecord *) arg;
StringInfoData buf; StringInfoData buf;
initStringInfo(&buf); initStringInfo(&buf);
RmgrTable[redoErrorCallBack->record->xl_rmid].rm_desc( RmgrTable[record->xl_rmid].rm_desc(&buf, record);
&buf,
redoErrorCallBack->record);
/* don't bother emitting empty description */ /* don't bother emitting empty description */
if (buf.len > 0) if (buf.len > 0)
......
...@@ -147,7 +147,6 @@ bool Debug_appendonly_rezero_quicklz_compress_scratch = false; ...@@ -147,7 +147,6 @@ bool Debug_appendonly_rezero_quicklz_compress_scratch = false;
bool Debug_appendonly_rezero_quicklz_decompress_scratch = false; bool Debug_appendonly_rezero_quicklz_decompress_scratch = false;
bool Debug_appendonly_guard_end_quicklz_scratch = false; bool Debug_appendonly_guard_end_quicklz_scratch = false;
bool gp_local_distributed_cache_stats = false; bool gp_local_distributed_cache_stats = false;
bool Debug_xlog_insert_print = false;
bool debug_xlog_record_read = false; bool debug_xlog_record_read = false;
bool Debug_cancel_print = false; bool Debug_cancel_print = false;
bool Debug_datumstream_write_print_small_varlena_info = false; bool Debug_datumstream_write_print_small_varlena_info = false;
...@@ -1610,17 +1609,6 @@ struct config_bool ConfigureNamesBool_gp[] = ...@@ -1610,17 +1609,6 @@ struct config_bool ConfigureNamesBool_gp[] =
NULL, NULL, NULL NULL, NULL, NULL
}, },
{
{"debug_xlog_insert_print", PGC_SUSET, DEVELOPER_OPTIONS,
gettext_noop("Print XLOG Insert record debugging information."),
NULL,
GUC_SUPERUSER_ONLY | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&Debug_xlog_insert_print,
false,
NULL, NULL, NULL
},
{ {
{"debug_xlog_record_read", PGC_SUSET, DEVELOPER_OPTIONS, {"debug_xlog_record_read", PGC_SUSET, DEVELOPER_OPTIONS,
gettext_noop("Print debug information for xlog record read."), gettext_noop("Print debug information for xlog record read."),
......
...@@ -257,7 +257,6 @@ extern bool gp_heap_require_relhasoids_match; ...@@ -257,7 +257,6 @@ extern bool gp_heap_require_relhasoids_match;
extern bool Debug_appendonly_rezero_quicklz_compress_scratch; extern bool Debug_appendonly_rezero_quicklz_compress_scratch;
extern bool Debug_appendonly_rezero_quicklz_decompress_scratch; extern bool Debug_appendonly_rezero_quicklz_decompress_scratch;
extern bool Debug_appendonly_guard_end_quicklz_scratch; extern bool Debug_appendonly_guard_end_quicklz_scratch;
extern bool Debug_xlog_insert_print;
extern bool debug_xlog_record_read; extern bool debug_xlog_record_read;
extern bool Debug_cancel_print; extern bool Debug_cancel_print;
extern bool Debug_datumstream_write_print_small_varlena_info; extern bool Debug_datumstream_write_print_small_varlena_info;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册