|
I definitely want to get this resolved ASAP if it's causing issues in the larger ecoystem. In the short term that probably stll means stringification, but longer-term I do want to be able to report large numbers correctly. Do the following steps seem reasonable to you?
1) Stringify everything suspicious. This means ruby bignums become strings on the way in to Facter, and anything greater than 2^53 becomes a string on the way out. This is probably overkill, but gets us to a solid baseline for consistent behavior and will avoid gross misbehaviors. (this is a refinement of what I proposed above, essentially).
2) Implement bignums internally. This will fix any numeric overflows in built-in facts (resolving disk sizes as negative, for example). This will also let us remove the stringification of Ruby values that are too large for 64-bit ints. We'll have to spend some time evaluating bignum libraries and getting our chosen one building across our supported platforms, so although this is a purely internal change, it's likely to be "effort", thus a step of its own.
3) Once we're sure the Puppet ecosystem can handle large integers, disable stringification at the output boundaries. At this point everything is correctly typed again, and we can pretend that none of this every happened. This will be a larger cross-team effort internally, and probably will involve some external documentation updates about what our various APIs accept/provide.
As for things like GCE IDs - we should be representing them as strings anyway. They may be made entirely of "digits", but they are logically single identifiers, not numbers. This is something we'll have to fix on a fact-by-fact basis, although turning large ints into strings at the various output boundaries should avoid compatibility issues in the medium term.
If you haven't already, can you file tickets against puppetdb and puppetserver with the issues you've seen in those projects? I will want to round up with the appropriate folks internally in order to develop a larger "bignum plan", and having tickets for the failure cases will make that much easier.
|