Before using hashcode for pdxType creation, we will check whether it is 
available or not. If it's not available then, we will use next available id. We 
have introduced this mechanism to harden the cases where the user ends up 
having two clusters with the same dsid.        From: Vishal Rao 
<vishal...@gmail.com>
 To: dev@geode.apache.org; Hitesh Khamesra <hkhame...@pivotal.io> 
Cc: Udo Kohlmeyer <ukohlme...@gmail.com>; Bruce Schuchardt 
<bschucha...@pivotal.io>; geode <d...@geode.incubator.apache.org>
 Sent: Thursday, November 17, 2016 11:51 PM
 Subject: Re: Review Request 53867: GEODE-2129 make pdxtype id random(not 
sequential)
   
Apologies if this is noise, but wouldn't using the hash code actually
increase the likelihood of ID collisions?

On Fri, Nov 18, 2016 at 6:11 AM, Hitesh Khamesra <hkhame...@pivotal.io>
wrote:

>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53867/
> -----------------------------------------------------------
>
> Review request for geode, Bruce Schuchardt and Udo Kohlmeyer.
>
>
> Repository: geode
>
>
> Description
> -------
>
> Right now pdxtype id has 4 bytes. Out of those 4 bytes, one byte reserved
> for distributed-system-id, this make sure type id generated from different
> cluster has different id. For rest of the three bytes we just increment
> counter to create new pdxtype id. In the field, we have observed that
> sometimes this pdxType Id collides. One reason could be they end up having
> same distributed-system-id for the different cluster.
> Thus to avoid a collision, we will be using hashcode of pdxType for three
> bytes of pdxType id. That will reduce the possibility of collision.
>
>
> Diffs
> -----
>
>  geode-core/src/main/java/org/apache/geode/pdx/internal/EnumId.java
> 5d399eb
>  geode-core/src/main/java/org/apache/geode/pdx/internal/PdxType.java
> b586f64
>  
>geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
> 0226cca
>  geode-core/src/test/java/org/apache/geode/pdx/PdxAttributesJUnitTest.java
> c45abce
>  geode-core/src/test/java/org/apache/geode/pdx/PdxSerializableJUnitTest.java
> 5cd822c
>  geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java
> f9c18ec
>  geode-wan/src/test/java/org/apache/geode/internal/cache/
> wan/misc/PDXNewWanDUnitTest.java f1e8f42
>
> Diff: https://reviews.apache.org/r/53867/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Hitesh Khamesra
>
>


-- 
"The World is a book, and those who do not travel read only a page." - St.
Augustine.


   

Reply via email to