Skip to content

Commit 30190f0

Browse files
author
vineeth
committed
bind_hash_mapping sampling logging changes w.r.t. longer corrid
1 parent 3e7926c commit 30190f0

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

worker/cppworker/worker/OCCChild.cpp

+19-3
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,27 @@ int OCCChild::handle_command(const int _cmd, std::string &_line)
10561056
{
10571057
if (config->is_switch_enabled("enable_bind_hash_logging", false)) {
10581058
bool skip = false;
1059-
if (m_corr_id.length() > 16) { // Max hex value that can be stored in ULLONG_MAX (FFFFFFFFFFFFFFFF)
1059+
if (m_corr_id.length() > 16 && m_corr_id.length() != 32) { // Max hex value that can be stored in ULLONG_MAX (FFFFFFFFFFFFFFFF); corrid.length() != 32 checked to handle new corrid with length 32
10601060
skip = true; // Reduce the logging noise.
10611061
}
10621062
if (!skip) {
1063-
unsigned long long int corrid = strtoull(m_corr_id.c_str(), NULL , 16);
1063+
unsigned long long int corrid;
1064+
unsigned long long int corrIdMsbVal;
1065+
unsigned long long int corrIdLsbVal;
1066+
bool longCorrId = false;
1067+
std::string corrIdMsb;
1068+
std::string corrIdLsb;
1069+
1070+
if (m_corr_id.length() == 32) {
1071+
longCorrId = true;
1072+
corrIdMsb = m_corr_id.substr(0, 16); // First 16 digits (Most Significant)
1073+
corrIdLsb = m_corr_id.substr(16, 16); // Last 16 digits (Least Significant)
1074+
corrIdMsbVal = strtoull(corrIdMsb.c_str(), NULL, 16);
1075+
corrIdLsbVal = strtoull(corrIdLsb.c_str(), NULL, 16);
1076+
} else {
1077+
corrid = strtoull(m_corr_id.c_str(), NULL , 16);
1078+
}
1079+
10641080
if (errno == ERANGE) {
10651081
std::ostringstream msg;
10661082
msg << "m_err=error on strtoull(), errno=" << errno;
@@ -1072,7 +1088,7 @@ int OCCChild::handle_command(const int _cmd, std::string &_line)
10721088
e_name.AddData("corr_id_", m_corr_id);
10731089
e_name.Completed();
10741090
}
1075-
if (!skip && (bit_mask == (corrid & bit_mask))) { // Allow
1091+
if (!skip && ((longCorrId && (bit_mask == (corrIdMsbVal & bit_mask)) && (bit_mask == (corrIdLsbVal & bit_mask))) || (!longCorrId && bit_mask == (corrid & bit_mask)))) { // Allow
10761092
if (bind_array->size() > 0) {
10771093
// Skip SQL with large number of binds
10781094
if (bind_array->size() > 5 || bind_array->at(0).get()->array_row_num > 1) {

0 commit comments

Comments
 (0)