Copies numbers validity checker #45
Labels
No labels
P0
P1
P2
P3
good first issue
pool
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#45
Loading…
Add table
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?
Is your feature request related to a problem? Please describe.
New
copies numbers
parameter of object.PUT request is related to placement policy of the container. We should have validation function to ignore invalidcopies numbers
parameters before and during request processing.Describe the solution you'd like
Add validation function which takes container policy and new
copies numbers
value and validates this tuple. Function should return some specific errors, so calling functions may useerror.Is
to define exact error type.@alexvanin, will such a func be general enough for SDK? Func's body will just compare
len
? What new custom errors do you see?As far as I understand, there is not only
len
requirement forcopies numbers
. Numbers should be less or equal thanREP
values?So I consider these errors, for example:
TrueCloudLab/frostfs-api#17 says nothing about REP number limitation.
Who gonna use that func? The node only?
Also, such a policy is correct:
"REP 4 SELECT 1 FROM *"
(well, ok, currently with--force
flag only infrostfs-cli
but"REP 3 SELECT 1 FROM *"
works even without--force
(in dev-env with 3+ nodes currently available, of course)), and only aPUT
can says that smth wrong (but an object will be persisted).copies_number
has not been used before and, therefore, it is hard to get inspired by the previous implementation (copies_number
12345 was ok forREP 3
but it looks more like a bug)./cc @TrueCloudLab/storage-core-committers
Let's clarify and discuss it. I originally thought, that we are implying that
copies number
value is less or equal thanREP
value.There might be the case, when client wants to store temporary more copies (if possible) than
REP
defines. If so, then API description is okay. If not, let's clarify that in specification.However both cases are naturally limited by
SELECT * CBF
value, so we can use it as a hard limit for copies numbers?This function is going to be used in back-ends for visual policy constructors. While front-end can create valid JSON of placement policy and
copies numbers
, it definetley can't validate complex logic of policies. So verification function with distinct error types can provide good feedback to the front-end.In the context of front-end policy constructors, policy validation function would be great too, but we have to create separate issue on that 😃.
Actually,
copies_number
can be bigger than the REP value, this way we could temporarily store e.g. 2 copies in oneREP 1
group, replicating it later on another node.@fyrchik, does that mean that we do not need request validation at all and only
PUT
requests' result can say smth aboutIncompleteObjectPut
? OrPUT
requests must not have more copies thanSELECT
*CBF
?I believe that the problem that we are trying to solve here is to avoid attaching incorrect vectors with S3 (it is written once and then attached to every PUT). So a separate function makes sense (we can reuse it in CLI, for example).
Validating this in the storage node seems error-prone, especially considering backwards compatibility and possible placement policy improvements. It is not a part of a protocol (like
incomplete object put
hasnode wasn't able to put some copy
semantics, notnode decided that it won't be able to do this in future
).We can always add it in future.