Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caijieming-ng
Copy link
Collaborator

No description provided.

@baidubot
Copy link
Collaborator

Reviewers: @bluebore @taocp @xupeilin

}
} // evict oldest log
} // new log open suc
}
Copy link
Collaborator

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_);
Copy link
Collaborator

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]) {}
Copy link
Collaborator

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.

@taocp
Copy link
Collaborator

taocp commented Nov 28, 2016

First of all, 'issue #1038' is not an issue but a PR;
Then, could you please describe (in English/Chinese) what do you want to do 😂

Why & What in human language first and then the code

@bluebore
Copy link
Collaborator

kan bu donga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants