| 1031 | self.cache_config = None |
| 1032 | |
| 1033 | def check_cache_compatibility(self): |
| 1034 | my_features = Manifest.SUPPORTED_REPO_FEATURES |
| 1035 | if self.cache_config.ignored_features & my_features: |
| 1036 | # The cache might not contain references of chunks that need a feature that is mandatory for some operation |
| 1037 | # and which this version supports. To avoid corruption while executing that operation force rebuild. |
| 1038 | return False |
| 1039 | if not self.cache_config.mandatory_features <= my_features: |
| 1040 | # The cache was build with consideration to at least one feature that this version does not understand. |
| 1041 | # This client might misinterpret the cache. Thus force a rebuild. |
| 1042 | return False |
| 1043 | return True |
| 1044 | |
| 1045 | def wipe_cache(self): |
| 1046 | logger.warning("Discarding incompatible cache and forcing a cache rebuild") |