Skip to content

Commit

Permalink
monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
haolinw committed Dec 19, 2024
1 parent 1f9e943 commit 70bcca1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions source/dnode/vnode/src/tsdb/tsdbCacheRead.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,35 @@ static int32_t saveOneRowForLastRaw(SLastCol* pColVal, SCacheRowsReader* pReader
return code;
}

// [TODO]
void print_ubacktrace(bool condition) {
if (!condition) return;

const char *flags = "Ouch!";
ELogLevel level = DEBUG_FATAL;
int32_t dflag = 255; // tsLogEmbedded ? 255 : uDebugFlag
// char buffer[10027];
// int32_t len = taosBuildLogHead(buffer, flags);

// va_list argpointer;
// va_start(argpointer, format);
// len = len + vsnprintf(buffer + len, LOG_MAX_LINE_BUFFER_SIZE - len, format, argpointer);
// va_end(argpointer);
// buffer[len++] = '\n';
// buffer[len] = 0;
// taosPrintLogImp(1, 255, buffer, len);

// taosPrintLog(flags, level, dflag, "tAssert at file %s:%d exit:%d", file, line, tsAssert);
taosPrintTrace(flags, level, dflag, -1);

// taosCloseLog();
// taosMsleep(300);

abort();

// return true;
}

static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds,
const int32_t* dstSlotIds, void** pRes, const char* idStr) {
int32_t code = TSDB_CODE_SUCCESS;
Expand Down Expand Up @@ -166,6 +195,8 @@ static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* p
uint32_t allocDataLen = bytes + pkBufLen;
uint32_t len = (allocDataLen < pColVal->colVal.value.nData ? allocDataLen : pColVal->colVal.value.nData);

print_ubacktrace(allocDataLen < pColVal->colVal.value.nData);

varDataSetLen(p->buf, pColVal->colVal.value.nData);
memcpy(varDataVal(p->buf), pColVal->colVal.value.pData, len);
p->bytes = len + VARSTR_HEADER_SIZE; // binary needs to plus the header size
Expand Down

0 comments on commit 70bcca1

Please sign in to comment.