Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/persistence/data_manager_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,8 @@ func IsBackgroundTransientError(err error) bool {
func HasMoreRowsToDelete(rowsDeleted, batchSize int) bool {
if rowsDeleted < batchSize || // all target tasks are deleted
rowsDeleted == UnknownNumRowsAffected || // underlying database does not support rows affected, so pageSize is not honored and all target tasks are deleted
rowsDeleted > batchSize { // pageSize is not honored and all tasks are deleted
rowsDeleted > batchSize ||
batchSize <= 0 { // if batchSize is <= 0 the attempt is for the request to be unbounded and remove all rows from min to max
return false
}
return true
Expand Down
3 changes: 3 additions & 0 deletions common/persistence/data_manager_interfaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ func TestHasMoreRowsToDelete(t *testing.T) {
assert.False(t, HasMoreRowsToDelete(11, 10))
assert.False(t, HasMoreRowsToDelete(9, 10))
assert.False(t, HasMoreRowsToDelete(-1, 10))
assert.False(t, HasMoreRowsToDelete(100, 0))
assert.False(t, HasMoreRowsToDelete(0, 0))
assert.False(t, HasMoreRowsToDelete(50, -1))

}
func TestTransferTaskInfo(t *testing.T) {
Expand Down
Loading