-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue #1038: enable leveldb posix log to switch and evict oldest one #1084
base: master
Are you sure you want to change the base?
Conversation
} | ||
} // evict oldest log | ||
} // new log open suc | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutex should be released here.
va_copy(backup_ap, ap); | ||
pl += vsnprintf(pl, limit - pl, format, backup_ap); | ||
va_end(backup_ap); | ||
cur_log_size_ += (pl >= limit) ? 30000: (pl - logbuf_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to get cur_log_size through the return value of PosixLogger::Logv to reduce duplicate calculation and memory copy.
log_count_(log_count), | ||
cur_log_size_(0), | ||
logger_(NULL), | ||
logbuf_(new char[30000]) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log_list_ should be initialized by list the directory.
First of all, 'issue #1038' is not an issue but a PR; Why & What in human language first and then the code |
kan bu donga |
No description provided.