|
|
-
Can master initialization be done after postStartMaster is called?
Ramkrishna.S.Vasudevan 2012-03-19, 13:05
Hi devs
Currently we set HMaster initialized=true before calling postStartMaster.
But if thro coprocessor we add some more code for some additional initialization or some cleanup work the master gets initialized even before that?
Can we initialize the master after postStartMaster? If it is ok I can file a JIRA for the same?
Regards
Ram
+
Ramkrishna.S.Vasudevan 2012-03-19, 13:05
-
Re: Can master initialization be done after postStartMaster is called?
Gary Helmling 2012-03-19, 17:30
Hi Ram,
The MasterObserver.postStartMaster() hook was added after we ran into a case where we wanted a single initialization point as soon as the active master was up for security implementation. In AccessController we use it to create the "_acl_" table if it doesn't exist. So in this case it made sense to wait until the active master was fully up.
This is admittedly a pretty specific case, so it may be worth rethinking some things as we generalize it. If you're looking to have a coprocessor perform some setup work required _before_ the active master is available, maybe we should also look at adding a MasterObserver.preStartMaster() hook?
Can you describe more how you're looking at applying this so we can all understand the interactions?
--gh
On Mon, Mar 19, 2012 at 6:05 AM, Ramkrishna.S.Vasudevan <[EMAIL PROTECTED]> wrote: > Hi devs > > > > Currently we set HMaster initialized=true before calling postStartMaster. > > But if thro coprocessor we add some more code for some additional > initialization or some cleanup work the master gets initialized even before > that? > > > > Can we initialize the master after postStartMaster? If it is ok I can file > a JIRA for the same? > > > > Regards > > Ram >
+
Gary Helmling 2012-03-19, 17:30
-
Re: Can master initialization be done after postStartMaster is called?
Gary Helmling 2012-03-19, 18:07
For the specific AccessController case, I think it would still work to move initialized = true after the call to the postStartMaster() hook in finishInitialization(). But moving this would prevent MasterObservers from calling any operation that winds up calling HMaster.checkInitialized(). This may be fine, just want to be sure we clearly identify the impact. On Mon, Mar 19, 2012 at 10:30 AM, Gary Helmling <[EMAIL PROTECTED]> wrote: > Hi Ram, > > The MasterObserver.postStartMaster() hook was added after we ran into > a case where we wanted a single initialization point as soon as the > active master was up for security implementation. In AccessController > we use it to create the "_acl_" table if it doesn't exist. So in this > case it made sense to wait until the active master was fully up. > > This is admittedly a pretty specific case, so it may be worth > rethinking some things as we generalize it. If you're looking to have > a coprocessor perform some setup work required _before_ the active > master is available, maybe we should also look at adding a > MasterObserver.preStartMaster() hook? > > Can you describe more how you're looking at applying this so we can > all understand the interactions? > > --gh > > On Mon, Mar 19, 2012 at 6:05 AM, Ramkrishna.S.Vasudevan > <[EMAIL PROTECTED]> wrote: >> Hi devs >> >> >> >> Currently we set HMaster initialized=true before calling postStartMaster. >> >> But if thro coprocessor we add some more code for some additional >> initialization or some cleanup work the master gets initialized even before >> that? >> >> >> >> Can we initialize the master after postStartMaster? If it is ok I can file >> a JIRA for the same? >> >> >> >> Regards >> >> Ram >>
+
Gary Helmling 2012-03-19, 18:07
-
RE: Can master initialization be done after postStartMaster is called?
Anoop Sam John 2012-03-20, 04:37
Hi, The issue that coprocessors can not call methods in HMaster which involves initialized check might be a concern. [for some use cases at least] "MasterObserver.preStartMaster() "- If we give this when this to be called? As per the name of the hook, before doing any start operations in Master? In a use case where some one want to perform some init related operations(in CP) at the end of the HMaster startup work and still not mark the master as initialized unless the coprocessor work is over, then the current postStart can not be used and also may be the preStart also. We might need provide other hooks?
Thanks -Anoop- ________________________________________ From: Gary Helmling [[EMAIL PROTECTED]] Sent: Monday, March 19, 2012 11:00 PM To: [EMAIL PROTECTED] Cc: rama krishna Subject: Re: Can master initialization be done after postStartMaster is called?
Hi Ram,
The MasterObserver.postStartMaster() hook was added after we ran into a case where we wanted a single initialization point as soon as the active master was up for security implementation. In AccessController we use it to create the "_acl_" table if it doesn't exist. So in this case it made sense to wait until the active master was fully up.
This is admittedly a pretty specific case, so it may be worth rethinking some things as we generalize it. If you're looking to have a coprocessor perform some setup work required _before_ the active master is available, maybe we should also look at adding a MasterObserver.preStartMaster() hook?
Can you describe more how you're looking at applying this so we can all understand the interactions?
--gh
On Mon, Mar 19, 2012 at 6:05 AM, Ramkrishna.S.Vasudevan <[EMAIL PROTECTED]> wrote: > Hi devs > > > > Currently we set HMaster initialized=true before calling postStartMaster. > > But if thro coprocessor we add some more code for some additional > initialization or some cleanup work the master gets initialized even before > that? > > > > Can we initialize the master after postStartMaster? If it is ok I can file > a JIRA for the same? > > > > Regards > > Ram >
+
Anoop Sam John 2012-03-20, 04:37
|
|