acelyc111 commented on code in PR #1397:
URL:
https://github.com/apache/incubator-pegasus/pull/1397#discussion_r1142943358
##########
src/replica/replica_chkpt.cpp:
##########
@@ -168,9 +169,10 @@ void replica::on_checkpoint_timer()
valid_start_offset,
(int64_t)FLAGS_log_private_reserve_max_size_mb * 1024 * 1024,
(int64_t)FLAGS_log_private_reserve_max_time_seconds);
- if (status() == partition_status::PS_PRIMARY)
-
_counter_private_log_size->set(_private_log->total_size() /
- 1000000);
+ if (status() == partition_status::PS_PRIMARY) {
+ METRIC_VAR_SET(private_log_size_mb,
+ _private_log->total_size() /
1000000);
Review Comment:
how about using `_private_log->total_size() >> 20` ?
##########
src/replica/replica.h:
##########
@@ -118,18 +119,20 @@ class test_checker;
}
#define CHECK_REQUEST_IF_SPLITTING(op_type)
\
- if (_validate_partition_hash) {
\
- if (_split_mgr->should_reject_request()) {
\
- response_client_##op_type(request, ERR_SPLITTING);
\
- _counter_recent_##op_type##_splitting_reject_count->increment();
\
- return;
\
- }
\
- if (!_split_mgr->check_partition_hash(
\
- ((dsn::message_ex *)request)->header->client.partition_hash,
#op_type)) { \
- response_client_##op_type(request, ERR_PARENT_PARTITION_MISUSED);
\
- return;
\
+ do {
\
+ if (_validate_partition_hash) {
\
Review Comment:
How about reduce indent like this?
```
if (!_validate_partition_hash) {
break;
}
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]