Optimize new ID generation in pilorama #593
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#593
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Here is an idea: instead of picking random ID in
Move()
and checking whether it exists, we could just pick the timestamp.It will save us some time (and memory).
Database format remains compatible, but we could have problems if this algorithm is used together with the old implementation (some nodes are updated, some are not). Having this stored inside of the DB does not help much: we can always lose SSD and start fresh.
Having this in the configuration seems wrong: it is not a local parameter and affects the whole network.
Think about network setting or some failsafe mechanism.
Forget about it, it's bad.
We can support "correct-only" usecases, where
Move
is done on already existing items. But in reality it is not a part of the API and we cannot prevent "incorrect" moves being applied.We still have a possible problem -- random numbers on different nodes can be equal (this is not hash, so the probability is non-negligible if the system works for years). Let's think about it in this task. The suggestion is to have them depend on epoch -- this way it works under all possible conditions. However, this in turn restricts the number of epochs: we need to get some numbers here (as an example -- first 4-bytes of the ID is an epoch, last 4 bytes are payload).
There are 2 ways to fight this: more bits for ID and proper snapshots.
To be clear, this is a hard task because protocol compatibility and storage format compatibility need to be taken into account.