Am 15.01.25 um 11:15 schrieb Fabian Grünbichler:
> 
>> Fiona Ebner <f.eb...@proxmox.com> hat am 15.01.2025 11:06 CET geschrieben:
>>
>>  
>> Am 15.01.25 um 10:51 schrieb Fabian Grünbichler:
>>>
>>> basically what we have is the following situation:
>>>
>>> - we have some input data (volid+snapname)
>>> - we have a key derived from the input data (block node name)
>>> - we have a value (block node)
>>> - we need to be be able to map back the block node (name) to the input data
>>
>> Oh, we need to map back too? But that can be done via filename in the
>> block node, or not?
> 
> but that filename is the result of PVE::Storage::path which is not stable, so 
> we can't compare that?
> 
> for snapshot operations, we need to find out "which block node is the one for 
> the snapshot volume". we can't rely on the filename in the block graph for 
> that, because how we map from volid+snapname to that filename might have 
> changed on our end since that bock node was set up. so we need to find a way 
> to map using (parts of) the block node name, which means
> - having a naming scheme that allows to map back from node name to 
> volid+snapname (i.e., the hashing scheme we are discussing ;))
> - never re-using a block node for something other than what is encoded in its 
> name (not sure if that possible?)
> 
> while an operation is ongoing, we can have $prefix-$hash-1 and 
> $prefix-$hash-2 at the same time, and if we then end up with having just 
> $prefix-$hash-2 after the operation that doesn't matter since we can reliably 
> map that back via the $hash to volid+snapname.

How would you map back from the hash? Wouldn't that require computing
the hashes for all known volid+snapname and comparing which one matches?
Or do you mean having a lookup-table, i.e. Perl hash keeping track of
the hash => volid+snapname mappings?


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to