You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Alan Conway <ac...@redhat.com> on 2012/11/09 16:34:07 UTC

Review Request: QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7988/
-----------------------------------------------------------

Review request for qpid.


Summary (updated)
-----------------

QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.


Description (updated)
-------

QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.

Imagine a cluster with primary A and backups B and C. A queue Q is created on A
and replicated to B, C. Now A dies and B takes over as primary. Before C can
connect to B, a client destroys Q and creates a new queue with the same name.
When B connects it sees Q and incorrectly assumes it is the same Q that it has
already replicated. Now C has an inconsistent replica of Q.

The fix is to tag queues/exchanges with a UUID so a backup can tell if a queue
is not the same as the one it has already replicated, even if the names are the
same.  This all also applies to exchanges.

- Minor imrovements to printing UUIDs in a FieldTable.
- Fix comparison of void Variants, added operator !=


Diffs (updated)
-----

  /trunk/qpid/cpp/include/qpid/framing/FieldValue.h 1407448 
  /trunk/qpid/cpp/include/qpid/types/Variant.h 1407448 
  /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/broker/ConfigurationObserver.h 1407448 
  /trunk/qpid/cpp/src/qpid/broker/Exchange.h 1407448 
  /trunk/qpid/cpp/src/qpid/broker/Exchange.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.h 1407448 
  /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/broker/Queue.h 1407448 
  /trunk/qpid/cpp/src/qpid/broker/Queue.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/framing/FieldValue.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/ha/Primary.h 1407448 
  /trunk/qpid/cpp/src/qpid/ha/Primary.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/ha/QueueReplicator.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/ha/types.h 1407448 
  /trunk/qpid/cpp/src/qpid/ha/types.cpp 1407448 
  /trunk/qpid/cpp/src/qpid/types/Variant.cpp 1407448 
  /trunk/qpid/cpp/src/tests/ha_test.py 1407448 
  /trunk/qpid/cpp/src/tests/ha_tests.py 1407448 

Diff: https://reviews.apache.org/r/7988/diff/


Testing
-------


Thanks,

Alan Conway


Re: Review Request: QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.

Posted by Alan Conway <ac...@redhat.com>.

> On Nov. 9, 2012, 4:50 p.m., Andrew Stitcher wrote:
> > /trunk/qpid/cpp/include/qpid/framing/FieldValue.h, line 183
> > <https://reviews.apache.org/r/7988/diff/1/?file=187658#file187658line183>
> >
> >     I can't see where this is used - is it actually needed?

It provides the string conversion used by getAsString() and when printing a UUID FieldValue. Formerly they were printed as a number, derived I'm not sure how, but not looking like a UUID.


- Alan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7988/#review13291
-----------------------------------------------------------


On Nov. 9, 2012, 3:34 p.m., Alan Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7988/
> -----------------------------------------------------------
> 
> (Updated Nov. 9, 2012, 3:34 p.m.)
> 
> 
> Review request for qpid.
> 
> 
> Description
> -------
> 
> QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.
> 
> Imagine a cluster with primary A and backups B and C. A queue Q is created on A
> and replicated to B, C. Now A dies and B takes over as primary. Before C can
> connect to B, a client destroys Q and creates a new queue with the same name.
> When B connects it sees Q and incorrectly assumes it is the same Q that it has
> already replicated. Now C has an inconsistent replica of Q.
> 
> The fix is to tag queues/exchanges with a UUID so a backup can tell if a queue
> is not the same as the one it has already replicated, even if the names are the
> same.  This all also applies to exchanges.
> 
> - Minor imrovements to printing UUIDs in a FieldTable.
> - Fix comparison of void Variants, added operator !=
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/include/qpid/framing/FieldValue.h 1407448 
>   /trunk/qpid/cpp/include/qpid/types/Variant.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ConfigurationObserver.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Exchange.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Exchange.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Queue.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Queue.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/framing/FieldValue.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/Primary.h 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/Primary.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/QueueReplicator.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/types.h 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/types.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/types/Variant.cpp 1407448 
>   /trunk/qpid/cpp/src/tests/ha_test.py 1407448 
>   /trunk/qpid/cpp/src/tests/ha_tests.py 1407448 
> 
> Diff: https://reviews.apache.org/r/7988/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alan Conway
> 
>


Re: Review Request: QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.

Posted by Alan Conway <ac...@redhat.com>.

> On Nov. 9, 2012, 4:50 p.m., Andrew Stitcher wrote:
> > /trunk/qpid/cpp/include/qpid/types/Variant.h, line 180
> > <https://reviews.apache.org/r/7988/diff/1/?file=187659#file187659line180>
> >
> >     I think it's a mistake to make the new operator any different from the existing ones.
> >     
> >     it should be exported and not inline viz:
> >      	
> >     QPID_TYPES_EXTERN bool operator!=(...);
> >     
> >     I think that having inline functions is a bad plan in an exported API/ABI. And qpidmessaging/qpidtypes is the only semi-official API we have.

I agree, will make the change.


- Alan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7988/#review13291
-----------------------------------------------------------


On Nov. 9, 2012, 3:34 p.m., Alan Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7988/
> -----------------------------------------------------------
> 
> (Updated Nov. 9, 2012, 3:34 p.m.)
> 
> 
> Review request for qpid.
> 
> 
> Description
> -------
> 
> QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.
> 
> Imagine a cluster with primary A and backups B and C. A queue Q is created on A
> and replicated to B, C. Now A dies and B takes over as primary. Before C can
> connect to B, a client destroys Q and creates a new queue with the same name.
> When B connects it sees Q and incorrectly assumes it is the same Q that it has
> already replicated. Now C has an inconsistent replica of Q.
> 
> The fix is to tag queues/exchanges with a UUID so a backup can tell if a queue
> is not the same as the one it has already replicated, even if the names are the
> same.  This all also applies to exchanges.
> 
> - Minor imrovements to printing UUIDs in a FieldTable.
> - Fix comparison of void Variants, added operator !=
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/include/qpid/framing/FieldValue.h 1407448 
>   /trunk/qpid/cpp/include/qpid/types/Variant.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ConfigurationObserver.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Exchange.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Exchange.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Queue.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Queue.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/framing/FieldValue.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/Primary.h 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/Primary.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/QueueReplicator.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/types.h 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/types.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/types/Variant.cpp 1407448 
>   /trunk/qpid/cpp/src/tests/ha_test.py 1407448 
>   /trunk/qpid/cpp/src/tests/ha_tests.py 1407448 
> 
> Diff: https://reviews.apache.org/r/7988/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alan Conway
> 
>


Re: Review Request: QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.

Posted by Andrew Stitcher <as...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7988/#review13291
-----------------------------------------------------------



/trunk/qpid/cpp/include/qpid/framing/FieldValue.h
<https://reviews.apache.org/r/7988/#comment28551>

    I can't see where this is used - is it actually needed?



/trunk/qpid/cpp/include/qpid/types/Variant.h
<https://reviews.apache.org/r/7988/#comment28550>

    I think it's a mistake to make the new operator any different from the existing ones.
    
    it should be exported and not inline viz:
     	
    QPID_TYPES_EXTERN bool operator!=(...);
    
    I think that having inline functions is a bad plan in an exported API/ABI. And qpidmessaging/qpidtypes is the only semi-official API we have.


- Andrew Stitcher


On Nov. 9, 2012, 3:34 p.m., Alan Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7988/
> -----------------------------------------------------------
> 
> (Updated Nov. 9, 2012, 3:34 p.m.)
> 
> 
> Review request for qpid.
> 
> 
> Description
> -------
> 
> QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.
> 
> Imagine a cluster with primary A and backups B and C. A queue Q is created on A
> and replicated to B, C. Now A dies and B takes over as primary. Before C can
> connect to B, a client destroys Q and creates a new queue with the same name.
> When B connects it sees Q and incorrectly assumes it is the same Q that it has
> already replicated. Now C has an inconsistent replica of Q.
> 
> The fix is to tag queues/exchanges with a UUID so a backup can tell if a queue
> is not the same as the one it has already replicated, even if the names are the
> same.  This all also applies to exchanges.
> 
> - Minor imrovements to printing UUIDs in a FieldTable.
> - Fix comparison of void Variants, added operator !=
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/include/qpid/framing/FieldValue.h 1407448 
>   /trunk/qpid/cpp/include/qpid/types/Variant.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ConfigurationObserver.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Exchange.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Exchange.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Queue.h 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/Queue.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/framing/FieldValue.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/Primary.h 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/Primary.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/QueueReplicator.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/types.h 1407448 
>   /trunk/qpid/cpp/src/qpid/ha/types.cpp 1407448 
>   /trunk/qpid/cpp/src/qpid/types/Variant.cpp 1407448 
>   /trunk/qpid/cpp/src/tests/ha_test.py 1407448 
>   /trunk/qpid/cpp/src/tests/ha_tests.py 1407448 
> 
> Diff: https://reviews.apache.org/r/7988/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alan Conway
> 
>