incubator-pegasus
incubator-pegasus copied to clipboard
fix:restart dup bug after recover a duplicating replica server
What problem does this PR solve?
#1595
What is changed and how does it work?
While adding duplication tasks to the Pegasus table, old version code will changing the 'duplicating' field in the in-memory 'app_info'.However, it is also necessary to persist the 'app_info' to disk. Cause during the replica "load" stage(one stage of replica initialization.Specifically,replica load some infomation from disk), the replica can read the correct 'app_info' information about duplication.So that ,replica can ensure current Pegasus App doing a duplication job. And plog GC logic will skip this replica,avoiding find an error decree when restart this replica duplication.
Tests
- Manual test
- Cluster test
Code changes
- Make private function
store_app_infoin replica.h public - Persist app_info when replica server recive duplication check map from meta
- Change the judgement logic of new dup map empty when replica server recive duplication check map (To avoid uncompletely init replica)