Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing pending objects is broken #140

Closed
mniewrzal opened this issue Feb 15, 2023 · 1 comment
Closed

Listing pending objects is broken #140

mniewrzal opened this issue Feb 15, 2023 · 1 comment
Assignees
Labels
bug Something isn't working Injection Added to sprint after sprint planning

Comments

@mniewrzal
Copy link
Contributor

mniewrzal commented Feb 15, 2023

I found quite old bug in listing code. When we are iterating over pending objects and we have more than 1000 (satellite side limit) we won't see more results. Iterator code is doing pages per max 1000 elements but it turns out that status field is not passed between pages. First ListObjects is having correct status with request but next request won't set it and satellite will get invalid status (0). It's working for committed objects because satellite have backward compatibility code to handle old uplinks which are not setting status at all and we are defaulting it to committed status. It looks that we are living with this issue since implementing multipart upload API.

func TestListUploads_Paging(t *testing.T) {
	testplanet.Run(t, testplanet.Config{
		SatelliteCount:   1,
		StorageNodeCount: 0,
		UplinkCount:      1,
	}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
		project, err := planet.Uplinks[0].OpenProject(ctx, planet.Satellites[0])
		require.NoError(t, err)
		defer ctx.Check(project.Close)

		createBucket(t, ctx, project, "testbucket")

		for i := 0; i < 10; i++ {
			_, err := project.BeginUpload(ctx, "testbucket", "object"+strconv.Itoa(i), nil)
			require.NoError(t, err)
		}

		listCtx := testuplink.WithListLimit(ctx, 3)
		list := project.ListUploads(listCtx, "testbucket", nil)

		items := 0
		for list.Next() {
			items++
		}
		require.Equal(t, 10, items)
	})
}
@mniewrzal mniewrzal added the bug Something isn't working label Feb 15, 2023
@storj-gerrit
Copy link

storj-gerrit bot commented Feb 15, 2023

Change https://review.dev.storj.io/c/storj/uplink/+/9596 mentions this issue.

@shaupt131 shaupt131 added the Injection Added to sprint after sprint planning label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Injection Added to sprint after sprint planning
Projects
Status: Done/Deployed
Development

No branches or pull requests

2 participants