Azure / azure-storage-cpp

Microsoft Azure Storage Client Library for C++
http://azure.github.io/azure-storage-cpp
Apache License 2.0
132 stars 148 forks source link

What is the target_location in continuation_token for? #201

Open yxiang92128 opened 6 years ago

yxiang92128 commented 6 years ago

I am performing a list operation (list_blobs_segmented) against primary and secondary storage location and if I set the target_location field in the continuation_token to "azure::storage::target_location(secondary)", no matter which end point I am pointing to (primary or secondary), it will just complain about: This operation can only be executed against the secondary storage location.

So can yo please tell me what the use of target location is for and if that field is even in use?

Thanks,

Yang

katmsft commented 6 years ago

The service's logic is that, since a continuation token is provided by either primary endpoint or secondary endpoint, the continuation token cannot be used to a mis-matched endpoint. Therefore when you specify the target location of a continuation token to secondary, there should be a restriction of the operation to be only performed to secondary location. Can you share how are you pointing the end point? Are you setting SECONDARY_ONLY? If the settings are correct this sounds like a bug to fix.

yxiang92128 commented 6 years ago

Hi Kan,

What happens is that I connected to "xxxxx-secondary.blob.core.windows.net" endpoint and set the target location to be "secondary", and it complains about "This operation can only be executed against the secondary storage location".

A related question just to clarify the logic: the continuation token should not be used if the location is now pointing to a different one? And a list operation should then be restarted? I wonder if there is a way to resume the list by continuing on the marker position.

thanks,

Yang