acelyc111 commented on code in PR #1217:
URL:
https://github.com/apache/incubator-pegasus/pull/1217#discussion_r1013179576
##########
src/replica/replica_stub.cpp:
##########
@@ -649,21 +648,21 @@ void replica_stub::initialize(const replication_options
&opts, bool clear /* = f
// restart log service
_log->close();
_log = nullptr;
- if (!utils::filesystem::remove_path(_options.slog_dir)) {
- dassert(false, "remove directory %s failed",
_options.slog_dir.c_str());
- }
+ CHECK(utils::filesystem::remove_path(_options.slog_dir),
+ "remove directory {} failed",
+ _options.slog_dir);
_log = new mutation_log_shared(_options.slog_dir,
_options.log_shared_file_size_mb,
_options.log_shared_force_flush,
&_counter_shared_log_recent_write_size);
- auto lerr = _log->open(nullptr, [this](error_code err) {
this->handle_log_failure(err); });
- dassert(lerr == ERR_OK, "restart log service must succeed");
+ CHECK_EQ_MSG(_log->open(nullptr, [this](error_code err) {
this->handle_log_failure(err); }),
Review Comment:
Good point!
Resolved
##########
src/aio/disk_engine.cpp:
##########
@@ -107,7 +107,7 @@ aio_task *disk_file::write(aio_task *tsk, void *ctx)
aio_task *disk_file::on_read_completed(aio_task *wk, error_code err, size_t
size)
{
- dassert(wk->next == nullptr, "");
+ CHECK(wk->next == nullptr, "");
Review Comment:
Because pointer is not streamable, so if using `CHECK_EQ`, an build error
will be threw:
```
./thirdparty/output/include/fmt/core.h:765:24: error: could not convert
'fmt::v5::to_string_view<dsn::task>(((const dsn::task*)((dsn::task*)val)))'
from 'fmt::v5::basic_string_view<dsn::task>' to 'std::enable_if<true,
fmt::v5::internal::init<fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
>, char>, fmt::v5::basic_string_view<char>, (fmt::v5::internal::type)11>
>::type {aka
fmt::v5::internal::init<fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
>, char>, fmt::v5::basic_string_view<char>, (fmt::v5::internal::type)11>}'
return to_string_view(val);
```
--
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]