You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/11/08 07:10:19 UTC

[GitHub] [incubator-pegasus] empiredan commented on a diff in pull request #1230: refactor(macro): use the more general CHECK_PREFIX* to replace dassert_replica

empiredan commented on code in PR #1230:
URL: https://github.com/apache/incubator-pegasus/pull/1230#discussion_r1016201282


##########
src/replica/replica_disk_migrator.cpp:
##########
@@ -171,11 +171,12 @@ bool replica_disk_migrator::check_migration_args(replica_disk_migrate_rpc rpc)
 // THREAD_POOL_REPLICATION_LONG
 void replica_disk_migrator::migrate_replica(const replica_disk_migrate_request &req)
 {
-    dassert_replica(status() == disk_migration_status::MOVING,
-                    "disk migration(origin={}, target={}), err = Invalid migration status({})",
-                    req.origin_disk,
-                    req.target_disk,
-                    enum_to_string(status()));
+    CHECK_EQ_MSG(status(),

Review Comment:
   ```suggestion
       CHECK_EQ_PREFIX_MSG(status(),
   ```



##########
src/replica/split/replica_split_manager.cpp:
##########
@@ -638,10 +638,8 @@ void replica_split_manager::parent_handle_child_catch_up(
         mutation_ptr mu = _replica->new_mutation(invalid_decree);
         mu->add_client_request(RPC_REPLICATION_WRITE_EMPTY, nullptr);
         _replica->init_prepare(mu, false);
-        dassert_replica(sync_point == mu->data.header.decree,
-                        "sync_point should be equal to mutation's decree, {} vs {}",
-                        sync_point,
-                        mu->data.header.decree);
+        CHECK_EQ_MSG(

Review Comment:
   ```suggestion
           CHECK_EQ_PREFIX_MSG(
   ```



##########
src/server/pegasus_server_impl.cpp:
##########
@@ -3284,7 +3284,8 @@ ::dsn::error_code pegasus_server_impl::flush_all_family_columns(bool wait)
 void pegasus_server_impl::release_db()
 {
     if (_db) {
-        dassert_replica(_data_cf != nullptr && _meta_cf != nullptr, "");
+        CHECK_NOTNULL_PREFIX_MSG(_data_cf, "");

Review Comment:
   Define another `CHECK_NOTNULL_PREFIX` for this ?



-- 
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