Skip to content

Commit af58e6f

Browse files
authored
Merge pull request #641 from ydb-platform/v3.42-fix-remove-recursive-topic
Remove topic in sugar.RemoveRecursive
2 parents 00d2bf4 + 65aa17e commit af58e6f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Supported `scheme.EntryTopic` path child entry in `sugar.RemoveRecursive`
2+
13
## v3.42.13
24
* Fixed default state of `internal/xerrors.retryableError`: it inherit properties from parent error as possible
35
* Marked event `grpc/stats.End` as ignored at observing status of grpc connection
@@ -12,7 +14,7 @@
1214
* Fixed validation error for topicoptions.WithPartitionID option of start topic writer.
1315

1416
## v3.42.10
15-
* Added exit from retryer if got grpc-error `Unauthenticated` on `discovery/ListEndpoints` call
17+
* Added exit from retryer if got grpc-error `Unauthenticated` on `discovery/ListEndpoints` call
1618

1719
## v3.42.9
1820
* Added `internal/xerrors.Errorf` error for wrap multiple errors and check them with `errors.Is` of `errors.As`

sugar/path.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ func RemoveRecursive(ctx context.Context, db ydb.Connection, pathToRemove string
105105
if err = list(i+1, pt); err != nil {
106106
return xerrors.WithStackTrace(err)
107107
}
108-
err = retry.Retry(ctx, func(ctx context.Context) (err error) {
109-
return db.Scheme().RemoveDirectory(ctx, pt)
110-
}, retry.WithIdempotent(true))
108+
err = db.Scheme().RemoveDirectory(ctx, pt)
111109
if err != nil {
112110
return xerrors.WithStackTrace(err)
113111
}
@@ -120,7 +118,14 @@ func RemoveRecursive(ctx context.Context, db ydb.Connection, pathToRemove string
120118
return xerrors.WithStackTrace(err)
121119
}
122120

121+
case scheme.EntryTopic:
122+
err = db.Topic().Drop(ctx, pt)
123+
if err != nil {
124+
return xerrors.WithStackTrace(err)
125+
}
126+
123127
default:
128+
return xerrors.WithStackTrace(fmt.Errorf("unknown entry type: %s", child.Type.String()))
124129
}
125130
}
126131
return nil

0 commit comments

Comments
 (0)