Comment 7 for bug 1516706

Revision history for this message
Hemanth Makkapati (hemanth-makkapati) wrote :

I don't think the issue here is a mere misconfiguration. Agreed that it shows up only when both v1 and v2 are enabled. And, this is especially evident when v2 is configured to run with registry, which is the default setting.

When v2 registry is enabled, we need the 'data_api' config to be set to 'glance.db.registry.api'. This is where things crossover from v1 to v2.

Looks like v1 uses the data_api for certain operations during image upload.
https://github.com/openstack/glance/blob/48ee8ef4793ed40397613193f09872f474c11abe/glance/api/v1/upload_utils.py#L87

And, at a couple of other places, too.

https://github.com/openstack/glance/blob/48ee8ef4793ed40397613193f09872f474c11abe/glance/common/store_utils.py#L51-L52
https://github.com/openstack/glance/blob/48ee8ef4793ed40397613193f09872f474c11abe/glance/common/store_utils.py#L87-L91

V1 uses the same config in the assumption that it is talking to the database directly. It is actually talking to v2 registry, which in turn talks to the database. This, I think, is the root-cause here.

I see two concerns here:
* The same config 'data_api' is used in two versions with different interpretations.
* V1 is actually talking to the database directly, which I thought was prohibited.

Finally, if I understand correctly, I don't think just adding a validation around 'enable_v1_api', 'enable_v1_registry', 'enable_v2_api' and 'enable_v2_registry' will solve this issue.

Thoughts?