empiredan commented on code in PR #1489:
URL:
https://github.com/apache/incubator-pegasus/pull/1489#discussion_r1210259088
##########
src/replica/replica_2pc.cpp:
##########
@@ -178,7 +179,8 @@ void replica::on_client_write(dsn::message_ex *request,
bool ignore_throttling)
}
if (FLAGS_reject_write_when_disk_insufficient &&
- (disk_space_insufficient() ||
_primary_states.secondary_disk_space_insufficient())) {
+ (_dir_node->status == ERR_DISK_INSUFFICIENT ||
Review Comment:
```suggestion
(_dir_node->status == disk_status::SPACE_INSUFFICIENT ||
```
##########
src/replica/replica_stub.cpp:
##########
@@ -2954,14 +2956,17 @@ replica_ptr
replica_stub::create_child_replica_if_not_found(gpid child_pid,
app_info *app,
const std::string
&parent_dir)
{
- FAIL_POINT_INJECT_F("replica_stub_create_child_replica_if_not_found",
- [=](dsn::string_view) -> replica_ptr {
- replica *rep = new replica(this, child_pid, *app,
"./", false);
- rep->_config.status =
partition_status::PS_INACTIVE;
- _replicas.insert(replicas::value_type(child_pid,
rep));
- LOG_INFO("mock create_child_replica_if_not_found
succeed");
- return rep;
- });
+ FAIL_POINT_INJECT_F(
+ "replica_stub_create_child_replica_if_not_found",
[=](dsn::string_view) -> replica_ptr {
+ const auto dn =
+ _fs_manager.create_child_replica_dir(app->app_type, child_pid,
parent_dir);
+ CHECK_NOTNULL(dn, "");
+ replica *rep = new replica(this, child_pid, *app, dn, false);
Review Comment:
```suggestion
auto *rep = new replica(this, child_pid, *app, dn, false);
```
--
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]