| 2874 | choose { |
| 2875 | when(wait(cx->onProxiesChanged())) {} |
| 2876 | when(GetKeyServerLocationsReply rep = wait(basicLoadBalance( |
| 2877 | cx->getCommitProxies(useProvisionalProxies), |
| 2878 | &CommitProxyInterface::getKeyServersLocations, |
| 2879 | GetKeyServerLocationsRequest( |
| 2880 | span.context, tenant, key, Optional<KeyRef>(), 100, isBackward, version, key.arena()), |
| 2881 | TaskPriority::DefaultPromiseEndpoint))) { |
| 2882 | ++cx->transactionKeyServerLocationRequestsCompleted; |
| 2883 | if (debugID.present()) |
| 2884 | g_traceBatch.addEvent( |
| 2885 | "TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocation.After"); |
| 2886 | ASSERT(rep.results.size() == 1); |
| 2887 | |
| 2888 | auto locationInfo = cx->setCachedLocation( |
| 2889 | tenant.name, rep.tenantEntry, rep.results[0].first, rep.results[0].second); |
| 2890 | updateTssMappings(cx, rep); |
| 2891 | updateTagMappings(cx, rep); |
| 2892 | |
| 2893 | return KeyRangeLocationInfo( |
| 2894 | rep.tenantEntry, |
| 2895 | KeyRange(toRelativeRange(rep.results[0].first, rep.tenantEntry.prefix), rep.arena), |
| 2896 | locationInfo); |
| 2897 | } |
| 2898 | } |
| 2899 | } |
| 2900 | } catch (Error& e) { |