Topic
  • 2 replies
  • Latest Post - ‏2012-07-17T20:09:58Z by Erwin_Karbasi
Erwin_Karbasi
Erwin_Karbasi
186 Posts

Pinned topic Partition id sequential

‏2012-07-15T10:41:36Z |
Hello Masters,

Are partition IDs sequential?

If one of partitions (i.e. primary shard) will fail and the replica will replace it, is the new shard's partition id will be the same as the previous shard partition id that failed?

Is it safe that the partition is will be sequential all the time?

Thanks in advance,
Erwin
Updated on 2012-07-17T20:09:58Z at 2012-07-17T20:09:58Z by Erwin_Karbasi
  • andymc_
    andymc_
    16 Posts

    Re: Partition id sequential

    ‏2012-07-17T14:44:50Z  
    Hi Erwin,

    Are partition IDs sequential?

    Yes - for the most part (see below for the caveat). Partition IDs start at 0 and grow to X which is defined in the deployment policy.

    If one of partitions (i.e. primary shard) will fail and the replica will replace it, is the new shard's partition id will be the same as the previous shard partition id that failed?

    Yes, the partition ID for the promoted replica will be the same.

    Is it safe that the partition is will be sequential all the time?

    If you are using PER_CONTAINER then there is a chance you won't have perfectly sequential partition IDs. For example, if you have your deployment policy configured for 5 partitions per container and have 6 containers, then you should have partitions 0 through 29 (5 primaries per container). If one of those containers fails, the replicas on other containers will be promoted to primaries. At the time of promotion, XS will remove the partition if it is found to be empty.

    Hope this helps,

    Andy
  • Erwin_Karbasi
    Erwin_Karbasi
    186 Posts

    Re: Partition id sequential

    ‏2012-07-17T20:09:58Z  
    • andymc_
    • ‏2012-07-17T14:44:50Z
    Hi Erwin,

    Are partition IDs sequential?

    Yes - for the most part (see below for the caveat). Partition IDs start at 0 and grow to X which is defined in the deployment policy.

    If one of partitions (i.e. primary shard) will fail and the replica will replace it, is the new shard's partition id will be the same as the previous shard partition id that failed?

    Yes, the partition ID for the promoted replica will be the same.

    Is it safe that the partition is will be sequential all the time?

    If you are using PER_CONTAINER then there is a chance you won't have perfectly sequential partition IDs. For example, if you have your deployment policy configured for 5 partitions per container and have 6 containers, then you should have partitions 0 through 29 (5 primaries per container). If one of those containers fails, the replicas on other containers will be promoted to primaries. At the time of promotion, XS will remove the partition if it is found to be empty.

    Hope this helps,

    Andy
    Hello Andy,

    Thank you a lot for clear information.

    Regards,
    Erwin