[#373] blobovnizca: Add missed/fix tracing spans

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-06-20 11:24:14 +03:00
parent 028d4a8058
commit a8526d45e9
10 changed files with 58 additions and 20 deletions

View file

@ -45,7 +45,7 @@ func (b *Blobovniczas) Put(ctx context.Context, prm common.PutPrm) (common.PutRe
PutPrm: putPrm,
}
if err := b.iterateDeepest(ctx, prm.Address, it.iterate); err != nil {
if err := b.iterateDeepest(ctx, prm.Address, func(s string) (bool, error) { return it.iterate(ctx, s) }); err != nil {
return common.PutRes{}, err
} else if it.ID == nil {
if it.AllFull {
@ -64,7 +64,7 @@ type putIterator struct {
PutPrm blobovnicza.PutPrm
}
func (i *putIterator) iterate(path string) (bool, error) {
func (i *putIterator) iterate(ctx context.Context, path string) (bool, error) {
active, err := i.B.getActivated(path)
if err != nil {
if !isLogical(err) {
@ -77,7 +77,7 @@ func (i *putIterator) iterate(path string) (bool, error) {
return false, nil
}
if _, err := active.blz.Put(i.PutPrm); err != nil {
if _, err := active.blz.Put(ctx, i.PutPrm); err != nil {
// Check if blobovnicza is full. We could either receive `blobovnicza.ErrFull` error
// or update active blobovnicza in other thread. In the latter case the database will be closed
// and `updateActive` takes care of not updating the active blobovnicza twice.
@ -99,7 +99,7 @@ func (i *putIterator) iterate(path string) (bool, error) {
return false, nil
}
return i.iterate(path)
return i.iterate(ctx, path)
}
i.AllFull = false