Uploaded image for project: 'Apache Helix'
  1. Apache Helix
  2. HELIX-657

Fix unexpected idealstate overwrite when persist assignment is on

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: helix-core
    • Labels:
      None

      Description

      We have identified an issue that resource idealstate may be unexpectedly overwritten when persist assignment is on.
      Basically, we are using "set" so any change made between reading and writing will be over written.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user jiajunwang opened a pull request:

          https://github.com/apache/helix/pull/95

          HELIX-657 Fix unexpected idealstate overwrite when persist assignme…

          …nt is on.

          1. Change persist method from set to update in PersistAssignmentStage.
          The new updater only overwrites map and list fields that the controller will update during PersistAssignmentStage.
          All the other updates from other sources that are made during controller read and write will be kept, as long as those fields are not purposely updated by the controller.
          If current node does not exist, new updater return null.
          2. Update accessors who relies on updater to check new data before applying the change. If the returned new data is null, should skip updating or creating.

          Also, add a test case for PersistAssignmentStage to cover the change.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/jiajunwang/helix bugfix

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/helix/pull/95.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #95


          commit 091337c4249f37fd3235c9cf630a861a6abee557
          Author: Jiajun Wang <jjwang@linkedin.com>
          Date: 2017-05-24T01:02:24Z

          HELIX-657 Fix unexpected idealstate overwrite when persist assignment is on.

          1. Change persist method from set to update in PersistAssignmentStage.
          The new updater only overwrites map and list fields that the controller will update during PersistAssignmentStage.
          All the other updates from other sources that are made during controller read and write will be kept, as long as those fields are not purposely updated by the controller.
          If current node does not exist, new updater return null.
          2. Update accessors who relies on updater to check new data before applying the change. If the returned new data is null, should skip updating or creating.

          Also, add a test case for PersistAssignmentStage to cover the change.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user jiajunwang opened a pull request: https://github.com/apache/helix/pull/95 HELIX-657 Fix unexpected idealstate overwrite when persist assignme… …nt is on. 1. Change persist method from set to update in PersistAssignmentStage. The new updater only overwrites map and list fields that the controller will update during PersistAssignmentStage. All the other updates from other sources that are made during controller read and write will be kept, as long as those fields are not purposely updated by the controller. If current node does not exist, new updater return null. 2. Update accessors who relies on updater to check new data before applying the change. If the returned new data is null, should skip updating or creating. Also, add a test case for PersistAssignmentStage to cover the change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jiajunwang/helix bugfix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/helix/pull/95.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #95 commit 091337c4249f37fd3235c9cf630a861a6abee557 Author: Jiajun Wang <jjwang@linkedin.com> Date: 2017-05-24T01:02:24Z HELIX-657 Fix unexpected idealstate overwrite when persist assignment is on. 1. Change persist method from set to update in PersistAssignmentStage. The new updater only overwrites map and list fields that the controller will update during PersistAssignmentStage. All the other updates from other sources that are made during controller read and write will be kept, as long as those fields are not purposely updated by the controller. If current node does not exist, new updater return null. 2. Update accessors who relies on updater to check new data before applying the change. If the returned new data is null, should skip updating or creating. Also, add a test case for PersistAssignmentStage to cover the change.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/helix/pull/95

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/helix/pull/95
          Hide
          jiajunwang Jiajun Wang added a comment -

          Fix merged.

          Show
          jiajunwang Jiajun Wang added a comment - Fix merged.

            People

            • Assignee:
              Unassigned
              Reporter:
              jiajunwang Jiajun Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development