Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove useless function 'last_flushed_decree()' #1456

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/replica/replica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,6 @@ mutation_ptr replica::new_mutation(decree decree)

decree replica::last_durable_decree() const { return _app->last_durable_decree(); }

decree replica::last_flushed_decree() const { return _app->last_flushed_decree(); }

decree replica::last_prepared_decree() const
{
ballot lastBallot = 0;
Expand Down
1 change: 0 additions & 1 deletion src/replica/replica.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba
decree last_committed_decree() const { return _prepare_list->last_committed_decree(); }
decree last_prepared_decree() const;
decree last_durable_decree() const;
decree last_flushed_decree() const;
const std::string &dir() const { return _dir; }
uint64_t create_time_milliseconds() const { return _create_time_ms; }
const char *name() const { return replica_name(); }
Expand Down
1 change: 0 additions & 1 deletion src/replica/replication_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ class replication_app_base : public replica_base
// Query methods.
//
virtual replication::decree last_durable_decree() const = 0;
virtual replication::decree last_flushed_decree() const { return last_durable_decree(); }
// The return type is generated by storage engine, e.g. rocksdb::Status::Code, 0 always mean OK.
virtual int on_request(message_ex *request) = 0;

Expand Down
7 changes: 1 addition & 6 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2615,11 +2615,6 @@ void pegasus_server_impl::update_app_envs(const std::map<std::string, std::strin
update_throttling_controller(envs);
}

int64_t pegasus_server_impl::last_flushed_decree() const
{
return _meta_store->get_last_flushed_decree();
}

void pegasus_server_impl::update_app_envs_before_open_db(
const std::map<std::string, std::string> &envs)
{
Expand Down Expand Up @@ -3251,7 +3246,7 @@ bool pegasus_server_impl::release_storage_after_manual_compact()
gc_checkpoints(true);
LOG_INFO_PREFIX("finish gc_checkpoints, time_used = {}ms", dsn_now_ms() - start_time);

int64_t new_last_durable = last_flushed_decree();
int64_t new_last_durable = _meta_store->get_last_flushed_decree();
if (new_last_durable > old_last_durable) {
LOG_INFO_PREFIX("release storage succeed, last_durable_decree changed from {} to {}",
old_last_durable,
Expand Down
2 changes: 0 additions & 2 deletions src/server/pegasus_server_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ class pegasus_server_impl : public pegasus_read_service

int64_t last_durable_decree() const override { return _last_durable_decree.load(); }

int64_t last_flushed_decree() const override;

void update_app_envs(const std::map<std::string, std::string> &envs) override;

void query_app_envs(/*out*/ std::map<std::string, std::string> &envs) override;
Expand Down