NetApp / trident

Storage orchestrator for containers
Apache License 2.0
762 stars 222 forks source link

RestClient.VolumeList sometimes returns incomplete result #846

Open AlpineCoder opened 1 year ago

AlpineCoder commented 1 year ago

Describe the bug I played around with the code of the ONTAP storage driver and discovered that RestClient.VolumeList sometimes returned inconsistent results if a large number of volumes (> 300 in my case) is involved.

Number of records in storage.VolumeCollectionGetOK.Payload.NumRecords is correct, however length of the storage.VolumeCollectionGetOK,Payload.VolumeResponseInlineRecords slice containg the records doesn't always match.

Turns out in getAllVolumePayloadRecords payload.VolumeResponseInlineRecords is not correctly appended.

Changing the line to: payload.VolumeResponseInlineRecords = append(payload.VolumeResponseInlineRecords, resultNext.Payload.VolumeResponseInlineRecords...)

fixed the issue for me. I also checked the methods for Qtrees and LUNs and they look correct.

Environment Latest code from GitHub

To Reproduce Steps to reproduce the behavior:

Use RestClient.VolumeList to get a large number of results. Force pagination to make sure to run in to the issue.

Expected behavior Length of slice storage.VolumeCollectionGetOK,Payload.VolumeResponseInlineRecords matches storage.VolumeCollectionGetOK.Payload.NumRecords and contents of the slice are correct.