Adam Litke has posted comments on this change. Change subject: utils: Add changehash function for change detection ......................................................................
Patch Set 4: (2 comments) https://gerrit.ovirt.org/#/c/33045/4/lib/vdsm/utils.py File lib/vdsm/utils.py: Line 1223: def changehash(*strings): Line 1224: """ Line 1225: Returns a hash of strings, suitable for change detection. Line 1226: Line 1227: Tipically changehash(string) is sent to client frequently. When a client Typically Line 1228: detect that the hash changed, it ask for string itself, which is typically Line 1229: much bigger. Line 1230: """ Line 1231: h = hashlib.sha1() Line 1231: h = hashlib.sha1() Line 1232: for s in strings: Line 1233: h.update(s) Line 1234: # Engine stores this in varchar(30) Line 1235: return h.hexdigest()[:30] How likely are we to experience a hash collision since we're taking only the last 30 chars? That seems like a bug in engine to me. Why don't we let them truncate the hash if they want to misuse it. -- To view, visit https://gerrit.ovirt.org/33045 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2242a594383e2d2fe64e3a581f18b8ac662648b0 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Jenkins CI RO Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: gerrit-hooks <[email protected]> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
