Allow to pass custom VUB for IR service calls #790
No reviewers
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#790
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/ir_vub"
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?
Closes #787
Now it is possible to specify valid until block for
frostfs-cli control ir
calls.Example:
4b42110e42
to316a6dd43a
@ -787,3 +790,1 @@
height, err := c.getTransactionHeight(hash)
if err != nil {
return 0, 0, fmt.Errorf("could not get transaction height: %w", err)
if hash != nil {
This fix doesn't relates to task, but fixes the situation when vub is computed in different places: in this function when hash != nil, and in notary, when hash == nil.
WIP: Allow to pass custom VUB for IR service callsto Allow to pass custom VUB for IR service calls@ -22,0 +30,4 @@
func parseVUB(cmd *cobra.Command) uint32 {
var err error
var vub uint32
if cmd.Flags().Lookup(irFlagNameVUB).Changed {
Why do we need this check? Default value is 0 and it is logically invalid.
I believe
cmd.Flags().GetUint32()
returns an error if the flag is missing in definitions and cobra prints error immediately otherwise, but this needs check.you are right, fixed
@ -13,2 +13,3 @@
// to ensure all nodes produce the same transaction with high probability.
func (c *Client) NewEpoch(epoch uint64, force bool) error {
// If vub > 0, vub will be used as valid until block value.
func (c *Client) NewEpoch(epoch uint64, vub uint32, force bool) (uint32, error) {
I feel like the interface is starting to blow up: we have 2 parameters specifically to cover IR control service needs.
How about using a separate method? #781 would be easier later and clients are not oblidged to provide unnecessary parameters.
This method called by IR and by wrapper, that passes
0
andfalse
. So looks like not complex.I have simplified wrapper's intrface.
Done
@ -801,0 +810,4 @@
if hash != nil {
return binary.LittleEndian.Uint32(hash.BytesLE()), height + c.notary.txValidTime, nil
}
return height + c.notary.txValidTime, height + c.notary.txValidTime, nil
Some comments are needed here, it could easily be a typo
Done
de828db8f9
to0a082e4ba4
0a082e4ba4
toa59c538729
a59c538729
toc327543c43
c327543c43
toc8a62ffedd
NewEpoch
method