empiredan commented on code in PR #1594:
URL:
https://github.com/apache/incubator-pegasus/pull/1594#discussion_r1329781944
##########
src/replica/replica_stub.h:
##########
@@ -361,6 +364,30 @@ class replica_stub : public serverlet<replica_stub>,
public ref_counter
replica_life_cycle get_replica_life_cycle(gpid id);
void on_gc_replica(replica_stub_ptr this_, gpid id);
+ struct replica_gc_info
+ {
+ replica_ptr rep;
+ partition_status::type status;
+ mutation_log_ptr plog;
+ decree last_durable_decree;
+ int64_t init_offset_in_shared_log;
+ };
+ using replica_gc_info_map = std::unordered_map<gpid, replica_gc_info>;
+
+ // Try to remove obsolete files of shared log for garbage collection
according to the provided
+ // states of all replicas. The purpose is to remove all of the files of
shared log, since it
+ // has been deprecated, and would not be appended any more.
+ void gc_slog(const replica_gc_info_map &replica_gc_map);
+
+ // The number of flushed replicas for the garbage collection of shared log
at a time should be
+ // limited.
+ void limit_flush_replicas_for_slog_gc(size_t prevent_gc_replica_count);
Review Comment:
Both flushing replicas to the disk and processing read/write requests would
consume much more IO resources. Too much flushes would affect read/write
requests. Thus it should be limited.
--
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]