mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +02:00
bitbake: hashserv: Improve behaviour for better determinism/sstate reuse
We have a choice of policy with hashequivalence - whether to reduce sstate duplication in the sstate feed to a minimum or have maximal sstate reuse from the user's perspective. The challenge is that non-matching outhashes are generated due to determinism issues, or due to differences in host gcc version, architecture and so on and the question is how to reconcile then. The approach before this patch is that any new match is added and matches can update. This has the side effect that a queried value from the server can change due to the replacement and you may not always get the same value from the server. With the client side caching bitbake has, this can be suboptimal and when using the autobuilder sstate feed, it results in poor artefact reuse. This patch switches to the other possible behaviour, once a hash is assigned, it doesn't change. This means some sstate artefacts may be duplicated but dependency chains aren't invalidated which I suspect may give better overall performance. Update the tests to match the new behaviour. (Bitbake rev: 20d6ac753efa364349100cdc863e5eabec8e5b78) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -413,7 +413,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
|
||||
# A matching output hash was found. Set our taskhash to the
|
||||
# same unihash since they are equivalent
|
||||
unihash = row['unihash']
|
||||
resolve = Resolve.REPLACE
|
||||
resolve = Resolve.IGNORE
|
||||
else:
|
||||
# No matching output hash was found. This is probably the
|
||||
# first outhash to be added.
|
||||
|
||||
@@ -392,15 +392,14 @@ class HashEquivalenceCommonTests(object):
|
||||
result = self.client.report_unihash(taskhash2, self.METHOD, outhash3, unihash2)
|
||||
self.assertEqual(result['unihash'], unihash2)
|
||||
|
||||
# Report Task 2. This is equivalent to Task 1, so will pick up the
|
||||
# unihash from that task
|
||||
# Report Task 2. This is equivalent to Task 1 but there is already a mapping for
|
||||
# taskhash2 so it will report unihash2
|
||||
result = self.client.report_unihash(taskhash2, self.METHOD, outhash1, unihash2)
|
||||
self.assertEqual(result['unihash'], unihash1)
|
||||
self.assertEqual(result['unihash'], unihash2)
|
||||
|
||||
# The originally reported unihash for Task 3 should have been updated
|
||||
# with the second report to use the new unihash from Task 1 (because is
|
||||
# shares a taskhash with Task 2)
|
||||
self.assertClientGetHash(self.client, taskhash2, unihash1)
|
||||
# The originally reported unihash for Task 3 should be unchanged even if it
|
||||
# shares a taskhash with Task 2
|
||||
self.assertClientGetHash(self.client, taskhash2, unihash2)
|
||||
|
||||
class TestHashEquivalenceUnixServer(HashEquivalenceTestSetup, HashEquivalenceCommonTests, unittest.TestCase):
|
||||
def get_server_addr(self, server_idx):
|
||||
|
||||
Reference in New Issue
Block a user