@@ -62,6 +62,7 @@ struct CommitProxyInterface {
62
62
RequestStream<struct ExclusionSafetyCheckRequest > exclusionSafetyCheckReq;
63
63
RequestStream<struct GetDDMetricsRequest > getDDMetrics;
64
64
PublicRequestStream<struct ExpireIdempotencyIdRequest > expireIdempotencyId;
65
+ PublicRequestStream<struct GetTenantIdRequest > getTenantId;
65
66
66
67
UID id () const { return commit.getEndpoint ().token ; }
67
68
std::string toString () const { return id ().shortString (); }
@@ -90,6 +91,7 @@ struct CommitProxyInterface {
90
91
getDDMetrics = RequestStream<struct GetDDMetricsRequest >(commit.getEndpoint ().getAdjustedEndpoint (9 ));
91
92
expireIdempotencyId =
92
93
PublicRequestStream<struct ExpireIdempotencyIdRequest >(commit.getEndpoint ().getAdjustedEndpoint (10 ));
94
+ getTenantId = PublicRequestStream<struct GetTenantIdRequest >(commit.getEndpoint ().getAdjustedEndpoint (11 ));
93
95
}
94
96
}
95
97
@@ -107,6 +109,7 @@ struct CommitProxyInterface {
107
109
streams.push_back (exclusionSafetyCheckReq.getReceiver ());
108
110
streams.push_back (getDDMetrics.getReceiver ());
109
111
streams.push_back (expireIdempotencyId.getReceiver ());
112
+ streams.push_back (getTenantId.getReceiver ());
110
113
FlowTransport::transport ().addEndpoints (streams);
111
114
}
112
115
};
@@ -361,10 +364,46 @@ struct GetReadVersionRequest : TimedRequest {
361
364
}
362
365
};
363
366
367
+ struct GetTenantIdReply {
368
+ constexpr static FileIdentifier file_identifier = 11441284 ;
369
+ int64_t tenantId = TenantInfo::INVALID_TENANT;
370
+
371
+ GetTenantIdReply () {}
372
+ GetTenantIdReply (int64_t tenantId) : tenantId(tenantId) {}
373
+
374
+ template <class Ar >
375
+ void serialize (Ar& ar) {
376
+ serializer (ar, tenantId);
377
+ }
378
+ };
379
+
380
+ struct GetTenantIdRequest {
381
+ constexpr static FileIdentifier file_identifier = 11299717 ;
382
+ SpanContext spanContext;
383
+ TenantName tenantName;
384
+ ReplyPromise<GetTenantIdReply> reply;
385
+
386
+ // This version is used to specify the minimum metadata version a proxy must have in order to declare that
387
+ // a tenant is not present. If the metadata version is lower, the proxy must wait in case the tenant gets
388
+ // created. If latestVersion is specified, then the proxy will wait until it is sure that it has received
389
+ // updates from other proxies before answering.
390
+ Version minTenantVersion;
391
+
392
+ GetTenantIdRequest () : minTenantVersion(latestVersion) {}
393
+ GetTenantIdRequest (SpanContext spanContext, TenantNameRef const & tenantName, Version minTenantVersion)
394
+ : spanContext(spanContext), tenantName(tenantName), minTenantVersion(minTenantVersion) {}
395
+
396
+ bool verify () const { return true ; }
397
+
398
+ template <class Ar >
399
+ void serialize (Ar& ar) {
400
+ serializer (ar, reply, spanContext, tenantName, minTenantVersion);
401
+ }
402
+ };
403
+
364
404
struct GetKeyServerLocationsReply {
365
405
constexpr static FileIdentifier file_identifier = 10636023 ;
366
406
Arena arena;
367
- TenantMapEntry tenantEntry;
368
407
std::vector<std::pair<KeyRangeRef, std::vector<StorageServerInterface>>> results;
369
408
370
409
// if any storage servers in results have a TSS pair, that mapping is in here
@@ -379,7 +418,7 @@ struct GetKeyServerLocationsReply {
379
418
380
419
template <class Ar >
381
420
void serialize (Ar& ar) {
382
- serializer (ar, results, resultsTssMapping, tenantEntry, resultsTagMapping, arena);
421
+ serializer (ar, results, resultsTssMapping, resultsTagMapping, arena);
383
422
}
384
423
};
385
424
0 commit comments