fix tablet merge dag log print
This commit is contained in:
		@ -20,7 +20,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace oceanbase
 | 
					namespace oceanbase
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
using namespace oceanbase::common;
 | 
					using namespace common;
 | 
				
			||||||
using namespace share;
 | 
					using namespace share;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace compaction
 | 
					namespace compaction
 | 
				
			||||||
@ -32,9 +32,9 @@ namespace compaction
 | 
				
			|||||||
    if (OB_FAIL(MTL(ObTenantDagScheduler*)->create_and_add_dag(¶m, dag, is_emergency))) {  \
 | 
					    if (OB_FAIL(MTL(ObTenantDagScheduler*)->create_and_add_dag(¶m, dag, is_emergency))) {  \
 | 
				
			||||||
      if (OB_SIZE_OVERFLOW != ret && OB_EAGAIN != ret) { \
 | 
					      if (OB_SIZE_OVERFLOW != ret && OB_EAGAIN != ret) { \
 | 
				
			||||||
        LOG_WARN("failed to create merge dag", K(ret), K(param)); \
 | 
					        LOG_WARN("failed to create merge dag", K(ret), K(param)); \
 | 
				
			||||||
      } else { \
 | 
					 | 
				
			||||||
        LOG_DEBUG("success to schedule tablet merge dag", K(ret), K(param)); \
 | 
					 | 
				
			||||||
      } \
 | 
					      } \
 | 
				
			||||||
 | 
					    } else { \
 | 
				
			||||||
 | 
					      LOG_DEBUG("success to schedule tablet merge dag", K(ret), K(param), K(*dag)); \
 | 
				
			||||||
    } \
 | 
					    } \
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -269,21 +269,29 @@ int ObBasicTabletMergeDag::get_tablet_and_compat_mode()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int64_t ObBasicTabletMergeDag::to_string(char* buf, const int64_t buf_len) const
 | 
					int64_t ObBasicTabletMergeDag::to_string(char* buf, const int64_t buf_len) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int ret = OB_SUCCESS;
 | 
					  int64_t pos = 0;
 | 
				
			||||||
  if (OB_FAIL(ObIDag::to_string(buf, buf_len))) {
 | 
					
 | 
				
			||||||
    LOG_WARN("failed to call to ObIDag::string", K(ret), K(buf_len));
 | 
					  if (OB_ISNULL(buf) || buf_len <= 0) {
 | 
				
			||||||
  } else if (OB_FAIL(param_.to_string(buf, buf_len))) {
 | 
					    // do nothing
 | 
				
			||||||
    LOG_WARN("failed to call to ObTabletMergeDagParam::string", K(ret), K(buf_len));
 | 
					  } else {
 | 
				
			||||||
  } else if (OB_FAIL(common::databuff_printf(buf, buf_len, ", compat_mode_=%d,", compat_mode_))) {
 | 
					    databuff_printf(buf, buf_len, pos, "{");
 | 
				
			||||||
    LOG_WARN("failed to print compat mode", K(ret), K(compat_mode_));
 | 
					    databuff_printf(buf, buf_len, pos, "ObIDag:");
 | 
				
			||||||
  } else if (OB_NOT_NULL(ctx_)) {
 | 
					    pos += ObIDag::to_string(buf + pos, buf_len - pos);
 | 
				
			||||||
    if (OB_FAIL(ctx_->sstable_version_range_.to_string(buf, buf_len))) {
 | 
					
 | 
				
			||||||
      LOG_WARN("failed to call to version range", K(ret), K(buf_len));
 | 
					    databuff_print_json_kv_comma(buf, buf_len, pos, "param", param_);
 | 
				
			||||||
    } else if (OB_FAIL(ctx_->scn_range_.to_string(buf, buf_len))) {
 | 
					    databuff_print_json_kv_comma(buf, buf_len, pos, "compat_mode", compat_mode_);
 | 
				
			||||||
      LOG_WARN("failed to call to log ts range", K(ret), K(buf_len));
 | 
					    if (nullptr == ctx_) {
 | 
				
			||||||
 | 
					      databuff_print_json_kv_comma(buf, buf_len, pos, "ctx", ctx_);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      databuff_printf(buf, buf_len, pos, ", ctx:{");
 | 
				
			||||||
 | 
					      databuff_print_json_kv(buf, buf_len, pos, "sstable_version_range", ctx_->sstable_version_range_);
 | 
				
			||||||
 | 
					      databuff_print_json_kv_comma(buf, buf_len, pos, "scn_range", ctx_->scn_range_);
 | 
				
			||||||
 | 
					      databuff_printf(buf, buf_len, pos, "}");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    databuff_printf(buf, buf_len, pos, "}");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return ret;
 | 
					
 | 
				
			||||||
 | 
					  return pos;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int ObBasicTabletMergeDag::inner_init(const ObTabletMergeDagParam ¶m)
 | 
					int ObBasicTabletMergeDag::inner_init(const ObTabletMergeDagParam ¶m)
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user