Skip to content

Commit

Permalink
fix issue 1922 (oceanbase#2011)
Browse files Browse the repository at this point in the history
* Update ob_mvcc_row.h

modify the note of function update_dml_flag_

* fix no obvious “secure_file_priv” prompt when load data error issue 981

fix no obvious “secure_file_priv” prompt when load data error issue 981

* fix no obvious “secure_file_priv” prompt when load data error issue 981

fix no obvious “secure_file_priv” prompt when load data error issue 981

* fix no obvious “secure_file_priv” prompt when load data error issue 981

fix no obvious “secure_file_priv” prompt when load data error issue 981

* Update ob_errno.h

fix no obvious “secure_file_priv” prompt when load data error issue 981

* Update ob_errno.cpp

fix no obvious “secure_file_priv” prompt when load data error issue 981

* Update ob_resolver_utils.cpp

fix no obvious “secure_file_priv” prompt when load data error issue 981

* Update ob_log_config.h

fix the issue 1786

* fix issue 1922

* fix issue 1922 0618

* fix issue 1922

* Revert "fix issue 1922"

This reverts commit 0e620f1.

* Revert "Revert "fix issue 1922""

This reverts commit ee79221.

* Revert "Revert "Revert "fix issue 1922"""

This reverts commit 9fbed3d.

* Revert "Revert "Revert "Revert "fix issue 1922""""

This reverts commit 5905050.

* Revert "Revert "Revert "Revert "Revert "fix issue 1922"""""

This reverts commit 2b83107.

* fix issue 1922  0625
  • Loading branch information
qiuyg3 authored Jul 2, 2024
1 parent 71056a7 commit c478c39
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/logservice/logminer/ob_log_miner_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ LogMinerLogger &LogMinerLogger::get_logminer_logger_instance()
static LogMinerLogger logger_instance;
return logger_instance;
}

LogMinerLogger::LogMinerLogger():
verbose_(false) { memset(pb_str_, '>', sizeof(pb_str_)); }
verbose_(false),
begin_ts_(0),
last_ts_(0),
last_record_num_(0)
{
memset(pb_str_, '>', sizeof(pb_str_));
}

void LogMinerLogger::log_stdout(const char *format, ...)
{
Expand Down Expand Up @@ -79,8 +86,29 @@ int LogMinerLogger::log_progress(int64_t record_num, int64_t current_ts, int64_t
nls_format, 0, time_buf, sizeof(time_buf), pos))) {
LOG_WARN("datetime to string failed", K(current_ts), K(LOGMINER_TZ.get_tz_info()));
} else {
fprintf(stdout, "\r%s %s %5.1lf%%, written records: %-20jd", time_buf, pb_buf,
progress, record_num);
int64_t current_time = ObTimeUtility::current_time();
int64_t average_rps = 0;
int64_t current_rps = 0;
int64_t inc_record_num = 0;
if (begin_ts_ == 0) {
begin_ts_ = current_time;
}
if (last_ts_ == 0) {
last_ts_ = current_time;
}
if (current_time - begin_ts_ > 0) {
// calculated in seconds
average_rps = record_num * 1000 * 1000 / (current_time - begin_ts_);
}
if (current_time - last_ts_ > 0) {
inc_record_num = record_num - last_record_num_;
// calculated in seconds
current_rps = inc_record_num * 1000 * 1000 / (current_time - last_ts_);
last_ts_ = current_time;
last_record_num_ = record_num;
}
fprintf(stdout, "\r%s %s %5.1lf%%, written records: %5.1jd, current rps: %5.1jd, average rps: %5.1jd",
time_buf, pb_buf, progress, record_num, current_rps, average_rps);
fflush(stdout);
}
return ret;
Expand Down
3 changes: 3 additions & 0 deletions src/logservice/logminer/ob_log_miner_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class LogMinerLogger {
static const int MAX_SCREEN_WIDTH = 4096;
bool verbose_;
char pb_str_[MAX_SCREEN_WIDTH];
int64_t begin_ts_;
int64_t last_ts_;
int64_t last_record_num_;
};

}
Expand Down

0 comments on commit c478c39

Please sign in to comment.