Limitations applied to swift zones values

Asked by Aleksey Kutepov on 2013-04-29

Hello,

I'm currently writing a logic for distributing nodes among swift zones.
I'm wondering if there any limitation for swift zone value except that it should be integer.
Some manuals claims that it should be continuous list of integers starting for 1(one). Some states that it should start from 0.
Looking at the swift sources I can't see any limitation regarding whether to start from or some other except it should be integer. As for me this is just an integer and nothing more.

I'd appreciate if someone can clarify this. Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
Samuel Merritt
Solved:
2013-04-29
Last query:
2013-04-29
Last reply:
2013-04-29
Best Samuel Merritt (torgomatic) said : #1

Yep, it's just an integer. To the best of my knowledge, Swift doesn't do any arithmetic on zone numbers, so you can use whatever integers you feel like.

However, I think there is some parsing code in bin/swift-ring-builder that restricts you to non-negative integers, so having a zone -17 probably won't work.

Aleksey Kutepov (kutepoff) said : #2

Thanks Samuel.

Indeed, it is impossible to set zone to -17 due to parsing algorithm limitation.

So, to summarizing the knowledge: swift zone can be any non-negative integer, swift zones for a cluster could be a sparse set of non-negative integers and it is not required to keep them as continuous set. This is all due to a semantic of swift zone value - it is only an ID of zone and nothing else. At least for Folsom and Grizzly releases.

Aleksey Kutepov (kutepoff) said : #3

Thanks Samuel Merritt, that solved my question.