You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "empiredan (via GitHub)" <gi...@apache.org> on 2023/03/15 11:28:14 UTC
[GitHub] [incubator-pegasus] empiredan opened a new pull request, #1397: feat(new_metrics): migrate replica-level metrics for replica class
empiredan opened a new pull request, #1397:
URL: https://github.com/apache/incubator-pegasus/pull/1397
https://github.com/apache/incubator-pegasus/issues/1342
--
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: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org
[GitHub] [incubator-pegasus] acelyc111 merged pull request #1397: feat(new_metrics): migrate replica-level metrics for replica class
Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 merged PR #1397:
URL: https://github.com/apache/incubator-pegasus/pull/1397
--
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: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org
[GitHub] [incubator-pegasus] empiredan commented on a diff in pull request #1397: feat(new_metrics): migrate replica-level metrics for replica class
Posted by "empiredan (via GitHub)" <gi...@apache.org>.
empiredan commented on code in PR #1397:
URL: https://github.com/apache/incubator-pegasus/pull/1397#discussion_r1143167677
##########
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:
OK.
##########
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:
OK.
--
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: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org
[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1397: feat(new_metrics): migrate replica-level metrics for replica class
Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
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: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org