Deltabase cross-channel delta handling completely wrong
|||Ubuntu system image||
It looks like handling of deltas between channels was broken since the very beginning.
Currently whenever a new image is created or copied from one place to another, system-image is generating delta images between channels in deltabase (or the channel itself if no deltabase is defined). There is a specific algorithm that tries to calculate which channels to consider from the deltabase, as the requirement is that the previous image of the delta-considered channel had to be present in the source channel - ensuring we have a 'common ancestor'. This algorithm currently is not doing what it's supposed to.
The current check for valid images in deltas assumes that image numbers are somehow unique to their contents - while in the current s-i implementation every channel has its own numbering and scheme. So the deltabase check looks for the selected image number in the source channel history and only generates a delta if that image number exists there. In our case an image numbered '3' in one channel can have absolutely different contents than an image '3' somewhere else, so this check makes no sense. It's also the reason why most frequently only one delta is generated, even though usually there should be more.