You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Aidan Skinner <ai...@gmail.com> on 2009/07/08 14:52:51 UTC

Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

On Wed, Jul 8, 2009 at 12:57 PM, Rafael Schloming<ra...@redhat.com> wrote:
> Martin Ritchie wrote:

>> Agreed, Though I think cleanBroker() needs to be improved as it would
>> be good to have the ablity to delete a data set from one of the
>> non-running brokers (Meaning we have other brokers running in the
>> test). I was thinking of a cluster test scenario where you stop broker
>> B and need to ensure it has no current data before you start it up
>> again and veify that it regains the cluster state. Not that we have
>> clustering in the Java code yet, but given that we can stop and start
>> any number of brokers via our tests we should think about how we can
>> clear a broker's data directories.
>
> I do agree it would be nice to have a base test case that provides tests
> with explicit control over starting, stoping, and cleaning brokers. The
> current cleanBroker() really wasn't intended to be used outside of the way
> it currently is inside of QpidTestCase. (In fact it should probably be
> private.)

Which nicely brings us back to the thing I was trying to address when
I started making these changes in the first place - Failover tests
need to be able to start and stop two brokers with stores.
PeristentStoreTest also needs to do something similar.

I'm not sure how I feel about the cleaning the store between each run
thing, having options for both is probably handy.

- Aidan

-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Gordon Sim <gs...@redhat.com>.
Aidan Skinner wrote:
> On Thu, Jul 9, 2009 at 9:03 AM, Gordon Sim<gs...@redhat.com> wrote:
> 
>> Rafael Schloming wrote:
>>> I don't know about this change, but it does seem like the configuration of
>>> persistent resources for the java broker needs some thinking through.
>>> Probably the cpp broker as well, last I checked it automatically creates a
>>> data-dir in your home directory if you don't specify one, and IMHO that's
>>> not particularly good form.
>> Do you think there should be a different default location (e.g. current
>> dir)? or that the user should be forced to specify a data-dir (or specify
>> --no-data-dir)?
> 
> /var/spool or maybe /var/lib would seem sensible choices on *nix to
> me. I have no idea where you'd put that sort of thing on Windows. I
> think defaulting to $HOME or cwd is a bit weird. Something to allow as
> an option at build time?

There is an init script (cpp/etc/qpidd) that sets data-dir to 
/var/lib/qpidd and that would be the common practice for an installed 
service. The defaulting to home or cwd is mainly for use by users 
without write permission to those directories.

I don't think having /var/lib/... as a built in default is in general 
the right thing. It could always be a build option, but I'm not at all 
convinced anyone would use that rather than the runtime option.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Aidan Skinner <ai...@gmail.com>.
On Thu, Jul 9, 2009 at 9:03 AM, Gordon Sim<gs...@redhat.com> wrote:

> Rafael Schloming wrote:
>>
>> I don't know about this change, but it does seem like the configuration of
>> persistent resources for the java broker needs some thinking through.
>> Probably the cpp broker as well, last I checked it automatically creates a
>> data-dir in your home directory if you don't specify one, and IMHO that's
>> not particularly good form.
>
> Do you think there should be a different default location (e.g. current
> dir)? or that the user should be forced to specify a data-dir (or specify
> --no-data-dir)?

/var/spool or maybe /var/lib would seem sensible choices on *nix to
me. I have no idea where you'd put that sort of thing on Windows. I
think defaulting to $HOME or cwd is a bit weird. Something to allow as
an option at build time?

- Aidan
-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Gordon Sim <gs...@redhat.com>.
Rafael Schloming wrote:
> Gordon Sim wrote:
>> Rafael Schloming wrote:
>>> I don't know about this change, but it does seem like the 
>>> configuration of persistent resources for the java broker needs some 
>>> thinking through. Probably the cpp broker as well, last I checked it 
>>> automatically creates a data-dir in your home directory if you don't 
>>> specify one, and IMHO that's not particularly good form.
>>
>> Do you think there should be a different default location (e.g. 
>> current dir)? or that the user should be forced to specify a data-dir 
>> (or specify --no-data-dir)?
> 
> I think we should either not have a default at all or default to 
> --no-data-dir.

I don't myself feel sufficiently strongly opposed to the current 
default, but I could live with those options if it was generally felt to 
be preferable.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Rafael Schloming <ra...@redhat.com>.
Gordon Sim wrote:
> Rafael Schloming wrote:
>> I don't know about this change, but it does seem like the 
>> configuration of persistent resources for the java broker needs some 
>> thinking through. Probably the cpp broker as well, last I checked it 
>> automatically creates a data-dir in your home directory if you don't 
>> specify one, and IMHO that's not particularly good form.
> 
> Do you think there should be a different default location (e.g. current 
> dir)? or that the user should be forced to specify a data-dir (or 
> specify --no-data-dir)?

I think we should either not have a default at all or default to 
--no-data-dir.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Gordon Sim <gs...@redhat.com>.
Rafael Schloming wrote:
> I don't know about this change, but it does seem like the configuration 
> of persistent resources for the java broker needs some thinking through. 
> Probably the cpp broker as well, last I checked it automatically creates 
> a data-dir in your home directory if you don't specify one, and IMHO 
> that's not particularly good form.

Do you think there should be a different default location (e.g. current 
dir)? or that the user should be forced to specify a data-dir (or 
specify --no-data-dir)?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Rafael Schloming <ra...@redhat.com>.
Martin Ritchie wrote:
> 2009/7/8 Rafael Schloming <ra...@redhat.com>:
>> Aidan Skinner wrote:
>>> On Wed, Jul 8, 2009 at 2:35 PM, Rafael Schloming<ra...@redhat.com>
>>> wrote:
>>>
>>>> Aidan Skinner wrote:
>>>>> On Wed, Jul 8, 2009 at 2:26 PM, Rafael Schloming<ra...@redhat.com>
>>>>> wrote:
>>>>>> Why can't the java profile just do the same thing?
>>>>> Lack of --data-dir. We should probably add that though. :)
>>>> Yes, especially if it would make the java profiles stop dumping things
>>>> like
>>>> derby.log and derbyDB outside the build dir. ;)
>>> I thought I'd beaten that out of DerbyMessageStore. Are you still
>>> seeing that running with java-derby?
>> It's definitely dumping derby.log into the root of the tree. It's possible
>> that the derbyDB dir was leftover from a while back. I've removed it and
>> will let you know if it reappears.
> 
> We have the ability to load a java broker configuration and modify it.
> I would argue that we don't need a --data-dir option but simply need
> to load the configuraiton file and set the work property to be the
> value that would be set for --data-dir.
> 
> The config-systest-derby.xml just needs to have the environment-path
> setup so it writes its files there by default rather than defaulting
> to up QPID_WORK from the system properties.

Are you suggesting that it's a fundamentally bad idea to have a 
--data-dir option or that it might simply be less work to change the way 
QpidTestCase launches brokers?

Either way I'd strongly suggest that if we make any changes to the test 
harness we really should take a step back and design a proper interface 
between the test harness and the broker/broker-launcher/whatever.

QpidTestCase is something of a nexus of interdependencies between 
hundreds of tests all with their own expectations running against two 
different brokers, each with at least three different configurations. 
Given this it's fairly delicate to make changes to the test harness, and 
is always more work than expected. Factoring out the broker 
start/clean/stop into a separate plugin might help isolate some of this, 
and would permit a relatively clean way to use completely different code 
to launch the different brokers.

Of course I'm forced to wonder if it's a good thing that we might 
require such different code to launch the different brokers. Currently 
the "interface", ad-hoc as it may be, is based on shell commands, so it 
sort of raises a red flag for me that you can't launch the java broker 
in the desired way with a simple shell command.

> This brings me back to the Change in DerbyMessageStore to pick up
> QPID_WORK directly which I don't agree this is correct. if the
> environment path is not set for Derby then the broker should fail to
> start up.

I don't know about this change, but it does seem like the configuration 
of persistent resources for the java broker needs some thinking through. 
Probably the cpp broker as well, last I checked it automatically creates 
a data-dir in your home directory if you don't specify one, and IMHO 
that's not particularly good form.

--Rafael

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Martin Ritchie <ri...@apache.org>.
2009/7/8 Rafael Schloming <ra...@redhat.com>:
> Aidan Skinner wrote:
>>
>> On Wed, Jul 8, 2009 at 2:35 PM, Rafael Schloming<ra...@redhat.com>
>> wrote:
>>
>>> Aidan Skinner wrote:
>>>>
>>>> On Wed, Jul 8, 2009 at 2:26 PM, Rafael Schloming<ra...@redhat.com>
>>>> wrote:
>>
>>>>> Why can't the java profile just do the same thing?
>>>>
>>>> Lack of --data-dir. We should probably add that though. :)
>>>
>>> Yes, especially if it would make the java profiles stop dumping things
>>> like
>>> derby.log and derbyDB outside the build dir. ;)
>>
>> I thought I'd beaten that out of DerbyMessageStore. Are you still
>> seeing that running with java-derby?
>
> It's definitely dumping derby.log into the root of the tree. It's possible
> that the derbyDB dir was leftover from a while back. I've removed it and
> will let you know if it reappears.

We have the ability to load a java broker configuration and modify it.
I would argue that we don't need a --data-dir option but simply need
to load the configuraiton file and set the work property to be the
value that would be set for --data-dir.

The config-systest-derby.xml just needs to have the environment-path
setup so it writes its files there by default rather than defaulting
to up QPID_WORK from the system properties.

This brings me back to the Change in DerbyMessageStore to pick up
QPID_WORK directly which I don't agree this is correct. if the
environment path is not set for Derby then the broker should fail to
start up.

Martin

> --Rafael
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>



-- 
Martin Ritchie

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Rafael Schloming <ra...@redhat.com>.
Aidan Skinner wrote:
> On Wed, Jul 8, 2009 at 2:35 PM, Rafael Schloming<ra...@redhat.com> wrote:
> 
>> Aidan Skinner wrote:
>>> On Wed, Jul 8, 2009 at 2:26 PM, Rafael Schloming<ra...@redhat.com>
>>> wrote:
> 
>>>> Why can't the java profile just do the same thing?
>>> Lack of --data-dir. We should probably add that though. :)
>> Yes, especially if it would make the java profiles stop dumping things like
>> derby.log and derbyDB outside the build dir. ;)
> 
> I thought I'd beaten that out of DerbyMessageStore. Are you still
> seeing that running with java-derby?

It's definitely dumping derby.log into the root of the tree. It's 
possible that the derbyDB dir was leftover from a while back. I've 
removed it and will let you know if it reappears.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Aidan Skinner <ai...@gmail.com>.
On Wed, Jul 8, 2009 at 2:35 PM, Rafael Schloming<ra...@redhat.com> wrote:

> Aidan Skinner wrote:
>>
>> On Wed, Jul 8, 2009 at 2:26 PM, Rafael Schloming<ra...@redhat.com>
>> wrote:

>>> Why can't the java profile just do the same thing?
>>
>> Lack of --data-dir. We should probably add that though. :)
>
> Yes, especially if it would make the java profiles stop dumping things like
> derby.log and derbyDB outside the build dir. ;)

I thought I'd beaten that out of DerbyMessageStore. Are you still
seeing that running with java-derby?

- Aidan
-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Rafael Schloming <ra...@redhat.com>.
Aidan Skinner wrote:
> On Wed, Jul 8, 2009 at 2:26 PM, Rafael Schloming<ra...@redhat.com> wrote:
> 
>>> Not really. You can't start two brokers with stores since the stores
>>> end up in the same place. Which is what the whole java.io.tmpdir stuff
>>> was about in any case.
>> That's not true. The cpp profile uses a separate data directory for each
>> broker started:
> 
> Yeah, sorry, should have said "two java brokers". :/
> 
>> Note the --data-dir argument.
>>
>> Why can't the java profile just do the same thing?
> 
> Lack of --data-dir. We should probably add that though. :)

Yes, especially if it would make the java profiles stop dumping things 
like derby.log and derbyDB outside the build dir. ;)

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Aidan Skinner <ai...@gmail.com>.
On Wed, Jul 8, 2009 at 2:26 PM, Rafael Schloming<ra...@redhat.com> wrote:

>> Not really. You can't start two brokers with stores since the stores
>> end up in the same place. Which is what the whole java.io.tmpdir stuff
>> was about in any case.
>
> That's not true. The cpp profile uses a separate data directory for each
> broker started:

Yeah, sorry, should have said "two java brokers". :/

> Note the --data-dir argument.
>
> Why can't the java profile just do the same thing?

Lack of --data-dir. We should probably add that though. :)

- Aidan
-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Rafael Schloming <ra...@redhat.com>.
Aidan Skinner wrote:
> On Wed, Jul 8, 2009 at 2:11 PM, Rafael Schloming<ra...@redhat.com> wrote:
> 
>> Aidan Skinner wrote:
> 
>>> Which nicely brings us back to the thing I was trying to address when
>>> I started making these changes in the first place - Failover tests
>>> need to be able to start and stop two brokers with stores.
>>> PeristentStoreTest also needs to do something similar.
>> Don't the failover tests already do this?
> 
> Not really. You can't start two brokers with stores since the stores
> end up in the same place. Which is what the whole java.io.tmpdir stuff
> was about in any case.

That's not true. The cpp profile uses a separate data directory for each 
broker started:

${project.root}/../cpp/src/qpidd -p @PORT --data-dir ${build.data}/@PORT

Note the --data-dir argument.

Why can't the java profile just do the same thing?

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Aidan Skinner <ai...@gmail.com>.
On Wed, Jul 8, 2009 at 2:11 PM, Rafael Schloming<ra...@redhat.com> wrote:

> Aidan Skinner wrote:

>> Which nicely brings us back to the thing I was trying to address when
>> I started making these changes in the first place - Failover tests
>> need to be able to start and stop two brokers with stores.
>> PeristentStoreTest also needs to do something similar.
>
> Don't the failover tests already do this?

Not really. You can't start two brokers with stores since the stores
end up in the same place. Which is what the whole java.io.tmpdir stuff
was about in any case.

Until a couple of weeks ago the second broker ended up being in the
same VM as well. :/

- Aidan

-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Multiple broker control in QpidTestCase (was Re: svn commit: r791954 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java)

Posted by Rafael Schloming <ra...@redhat.com>.
Aidan Skinner wrote:
> On Wed, Jul 8, 2009 at 12:57 PM, Rafael Schloming<ra...@redhat.com> wrote:
>> Martin Ritchie wrote:
> 
>>> Agreed, Though I think cleanBroker() needs to be improved as it would
>>> be good to have the ablity to delete a data set from one of the
>>> non-running brokers (Meaning we have other brokers running in the
>>> test). I was thinking of a cluster test scenario where you stop broker
>>> B and need to ensure it has no current data before you start it up
>>> again and veify that it regains the cluster state. Not that we have
>>> clustering in the Java code yet, but given that we can stop and start
>>> any number of brokers via our tests we should think about how we can
>>> clear a broker's data directories.
>> I do agree it would be nice to have a base test case that provides tests
>> with explicit control over starting, stoping, and cleaning brokers. The
>> current cleanBroker() really wasn't intended to be used outside of the way
>> it currently is inside of QpidTestCase. (In fact it should probably be
>> private.)
> 
> Which nicely brings us back to the thing I was trying to address when
> I started making these changes in the first place - Failover tests
> need to be able to start and stop two brokers with stores.
> PeristentStoreTest also needs to do something similar.

Don't the failover tests already do this?

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org