cloudfoundry-attic / cf-abacus

CF usage metering and aggregation
Apache License 2.0
98 stars 86 forks source link

seqid id not always unique #691

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi,

The id generated by the seqid package is not guaranteed to be unique: https://github.com/cloudfoundry-incubator/cf-abacus/blob/94ce220b6217380a52644697fce48dbf981c30d4/lib/utils/seqid/src/index.js#L25-L40

My understanding is that the generated id needs to be globally unique and locally (process-wise) incrementing. Though the latter is true, there are cases when the former might not hold. For example, if the Cloud Foundry Runner hosting the application were to lose connectivity the health management system of Cloud Foundry, it is possbile that Cloud Foundry spawns a duplicate application - in which case the produced IDs would be differentiated only by moment.now().

At this point in time this is purely hypothetical and I don't have a real-life occurance example of that, but looking at the code I decided to bring it up.

cf-gitbot commented 7 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/149386387

The labels on this github issue will be updated when the story is started.