Comment 14 for bug 2048103

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

@lujiefsi: Thanks for investigating and reporting back.

There was actually a discussion on the mailing list a few months back about limiting the length of image additional properties:

https://<email address hidden>/thread/B7UET4JKHQU5SHH44KLSKHFBMFN3ZZYV/#B7UET4JKHQU5SHH44KLSKHFBMFN3ZZYV

A former Glance PTL was against the proposal because it would be a backward-incompatible change, but I don't think the performance issue was discussed in that thread. Also, the original email in the thread asked for anyone who had a use case that would be affected by the change, and no one responded to that question.

Since glance, nova, cinder (and possibly, ironic) all store image metadata, this impacts all 3 (or 4) APIs. Nova is sort of unilaterally putting a 255 char (or byte -- I'm not sure) limit on image property values. The cinder change that prompted the above email thread is enforcing a 65535 byte limit via JSON schema validation.

I think the slowdown issue is something we should take seriously, but I don't know if 255 chars is too restrictive if, for example, people are storing a string of JSON in an image property that's used by some kind of deployment tool. We could maybe restrict to 512 or 1024 chars or something like that, and wouldn't have to migrate from a text field to varchar (I think the slowdown is from stuffing all those chars into JSON when generating the response, not from the way the data is stored in the DB).

Because this impacts 3 or 4 APIs, I don't think we want to go the config option route; I think we need to just decide what is a suitable length and enforce it. (But that's just my opinion.)