incubator-pegasus icon indicating copy to clipboard operation
incubator-pegasus copied to clipboard

fix:restart dup bug after recover a duplicating replica server

Open ninsmiracle opened this issue 2 years ago • 0 comments

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
  1. Make private function store_app_info in replica.h public
  2. Persist app_info when replica server recive duplication check map from meta
  3. Change the judgement logic of new dup map empty when replica server recive duplication check map (To avoid uncompletely init replica)

ninsmiracle avatar Sep 14 '23 08:09 ninsmiracle