Re: Is HiveServer2 rolling restart wrongly deregister the new HiveServer2 instance?

2016-02-19 Thread Jonathan Hurley
No, even though the new hive command is used to invoke the de-register, the 
version which is used is from params.current_version, which is the version of 
hive before upgrade; vs the desired_version which is the post-upgrade version.

> On Feb 19, 2016, at 6:07 PM, Di Li  wrote:
> 
> Hello there,
> 
> I am looking at Hive Server2 rolling ugprade code.
> 
> For the code here, Ambari issues post_upgrade_deregister() at the end of the 
> start method call. The deregister calculates the "current version" of Hive 
> via hive --version cmd.
> Since the deregister is at the end of the start method, is the version 
> calculated be the one for the update hive and thus the deregister is 
> deregister the new hive server2 instance (the one started on 10010). I think 
> the goal is to deregister the old instance running on 1 port.
> 
> def start(self, env, upgrade_type=None):
> import params
> env.set_params(params)
> self.configure(env) # FOR SECURITY
> 
> hive_service( 'hiveserver2', action = 'start', upgrade_type=upgrade_type)
> 
> # only perform this if upgrading and rolling; a non-rolling upgrade 
> doesn't need
> # to do this since hive is already down
> if upgrade_type == UPGRADE_TYPE_ROLLING:
>   hive_server_upgrade.post_upgrade_deregister()



Is HiveServer2 rolling restart wrongly deregister the new HiveServer2 instance?

2016-02-19 Thread Di Li
Hello there,

I am looking at Hive Server2 rolling ugprade code.

For the code here, Ambari issues post_upgrade_deregister() at the end of the 
start method call. The deregister calculates the "current version" of Hive via 
hive --version cmd.
Since the deregister is at the end of the start method, is the version 
calculated be the one for the update hive and thus the deregister is deregister 
the new hive server2 instance (the one started on 10010). I think the goal is 
to deregister the old instance running on 1 port.

def start(self, env, upgrade_type=None):
    import params
    env.set_params(params)
    self.configure(env) # FOR SECURITY

    hive_service( 'hiveserver2', action = 'start', upgrade_type=upgrade_type)

    # only perform this if upgrading and rolling; a non-rolling upgrade doesn't 
need
    # to do this since hive is already down
    if upgrade_type == UPGRADE_TYPE_ROLLING:
  hive_server_upgrade.post_upgrade_deregister()