Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Update hash algo to 64bit to reduce collisions #283

Merged
merged 6 commits into from
Sep 8, 2022
Merged

Conversation

EngHabu
Copy link
Contributor

@EngHabu EngHabu commented Aug 23, 2022

Signed-off-by: Haytham Abuelfutuh [email protected]

TL;DR

We use 64bit fnv hashing to shorten the execution id lengths, however that has lead to collisions due to its low entropy. Bumping it to 64bit to reduce such collisions.

  • Figure out how to rollout the change without affecting in-flight executions.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Tracking Issue

flyteorg/flyte#2778

@EngHabu EngHabu changed the title Update Encoding Length hash to 64bit to reduce collisions Update hash algo to 64bit to reduce collisions Aug 23, 2022
@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Merging #283 (dc3b2dc) into master (cdfc191) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #283      +/-   ##
==========================================
+ Coverage   63.26%   63.34%   +0.07%     
==========================================
  Files         145      145              
  Lines        9266     9278      +12     
==========================================
+ Hits         5862     5877      +15     
+ Misses       2870     2866       -4     
- Partials      534      535       +1     
Flag Coverage Δ
unittests 62.77% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
go/tasks/pluginmachinery/encoding/encoder.go 100.00% <100.00%> (ø)
go/tasks/plugins/array/awsbatch/executor.go 38.05% <0.00%> (-4.93%) ⬇️
go/tasks/plugins/array/k8s/executor.go 39.65% <0.00%> (+0.15%) ⬆️
go/tasks/plugins/array/catalog.go 49.31% <0.00%> (+0.73%) ⬆️
go/tasks/plugins/array/k8s/management.go 57.21% <0.00%> (+1.43%) ⬆️
go/tasks/plugins/array/awsbatch/launcher.go 63.46% <0.00%> (+5.56%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Haytham Abuelfutuh <[email protected]>
hamersaw
hamersaw previously approved these changes Aug 31, 2022
Copy link
Contributor

@hamersaw hamersaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the max execution name length just increased to 63 in this PR. Do we want to use a 128 bit version of the algorithm?

go/tasks/pluginmachinery/encoding/encoder.go Outdated Show resolved Hide resolved
@hamersaw
Copy link
Contributor

hamersaw commented Aug 31, 2022

Looks like the max execution name length just increased to 63 in this PR. Do we want to use a 128 bit version of the algorithm?

On second thought, probably a bad idea. We'll start running into issues with task id length.

edit: maybe not?!?! this code is pretty complex.

@EngHabu
Copy link
Contributor Author

EngHabu commented Sep 1, 2022

@hamersaw Unfortunately we can't guarantee the Admin version propeller will be talking to. I can add support for 128 in the plugins PR though... The admin PR should have bumped the EventVersion in the propeller CRD so that propeller code and make decisions based on the updated Admin..

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@EngHabu EngHabu merged commit 9ccfa70 into master Sep 8, 2022
eapolinario pushed a commit that referenced this pull request Sep 6, 2023
* Update Encoding Length hash to 64bit to reduce collisions

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Allow customization of hashing algorithm

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Fix tests and add an algorithm test

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* docs

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Support 128-bit fnv as well

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* tab -> spaces

Signed-off-by: Haytham Abuelfutuh <[email protected]>

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants