Limitations applied to swift zones values

Asked by Aleksey Kutepov on 2013-04-29


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

English Edit question
OpenStack Object Storage (swift) Edit question
No assignee Edit question
Solved by:
Samuel Merritt
Last query:
Last reply:
Revision history for this message
Best Samuel Merritt (torgomatic) said :

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.

Revision history for this message
Aleksey Kutepov (kutepoff) said :

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.

Revision history for this message
Aleksey Kutepov (kutepoff) said :

Thanks Samuel Merritt, that solved my question.