Comment 6 for bug 1678018

Revision history for this message
Alistair Coles (alistair-coles) wrote :

I propose making diskfile persist all metadata keys and values as either bytes or unicode. All items apart from the footer metadata are already persisted as bytes. The footer metadata values are encoded to bytes by HeaderKeyDict that they are stored in by the object server.

So that leaves just the footer keys that by virtue of json parsing are unicode. We could have the object server encode those keys. That would fix things going forwards but still leave a problem with existig diskfiles with unicode keys in metadata. So I propose that diskfile should encode in both the write_metadata() (going forwards) and read_metadata() (for legacy metadata). We could of course just encode in read_metadata() but it seems less confusing going forwards to have a uniform type persisted in diskfile.