[
https://issues.apache.org/jira/browse/AMBARI-12125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14599855#comment-14599855
]
Hudson commented on AMBARI-12125:
---------------------------------
SUCCESS: Integrated in Ambari-branch-2.1 #105 (See
[https://builds.apache.org/job/Ambari-branch-2.1/105/])
AMBARI-12125. If agent is not restarted after upgrade, it reads new version
file and registers as a new version (dlysnichenko) (dlysnichenko:
http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=7e84904b10c11ff918baf81f314960b1bde580b2)
* ambari-agent/src/main/python/ambari_agent/Register.py
* ambari-agent/src/test/python/ambari_agent/TestController.py
* ambari-agent/src/main/python/ambari_agent/Controller.py
* ambari-agent/src/test/python/ambari_agent/TestRegistration.py
> If agent is not restarted after upgrade, it reads new version file and
> registers as a new version
> -------------------------------------------------------------------------------------------------
>
> Key: AMBARI-12125
> URL: https://issues.apache.org/jira/browse/AMBARI-12125
> Project: Ambari
> Issue Type: Bug
> Components: ambari-server
> Reporter: Dmitry Lysnichenko
> Assignee: Dmitry Lysnichenko
> Fix For: 2.1.0
>
> Attachments: AMBARI-12125.patch
>
>
> I think now I understand how issue occurs.
> I had consideration for a while that traceback does not match lines in
> CustomServiceOrchestrator.py source. Now the picture is complete: line
> numbers match exactly CustomServiceOrchestrator.py as it appears in 2.0.maint
> branch.
> That means that agent on affected host was upgraded, but not restarted after
> package upgrade.
> The bug here is in workflow:
> - server is upgraded
> - agents on hosts are upgraded. Linux systems allow overwriting files in use
> (e.g. running binaries)
> - agent on all hosts but one are restarted
> - server is restarted
> - agent, that was not upgraded, registers on server. During registration, it
> provides version that appears at /var/lib/ambari-agent/data/version file. But
> agent version file is already upgraded! So *old* agent executable reads *new*
> version file, and successfully registers on server.
> That is an actual bug.
> The fix probably would be to substitute agent version directly into agent
> script, and not into separate files. Python would not re-import sources after
> upgrade.
> The same applies to the server upgrade.
> Another option is to check if agent is running from package upgrade scripts.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)