diff --git a/rfc/0057-sdk3-analytics.md b/rfc/0057-sdk3-analytics.md index 356fb9e..b55e76b 100644 --- a/rfc/0057-sdk3-analytics.md +++ b/rfc/0057-sdk3-analytics.md @@ -191,6 +191,25 @@ class AnalyticsWarning { } ``` +## Cluster compatibility +With the upcoming release of Enterprise Analytics, and the risk of users accidentally using operational SDKs against it, a compatibility check is being added. + +[MB-67103](https://jira.issues.couchbase.com/browse/MB-67103) adds to the cluster and bucket configs a `prodName` string field identifying the cluster type. + +Before performing each analytics operation, check the cluster config, and iff the prodName field is present, check if it starts with "Couchbase Server". If it doesn't, fast-fail the request with a generic `CouchbaseException`. A suitable error message could be: + +``` +var errStr = "This '${prodName}' cluster cannot be used with this SDK, which is intended for use with operational clusters." +if (prodName == "Enterprise Analytics") { + errStr += ". For this cluster, an Enterprise Analytics SDK should be used." +} +throw new CouchbaseException(errStr) +``` + +If the cluster config is not yet available, wait for it using the request timeout. On timeout follow standard timeout rules. + +For discussion of why "Couchbase Server" is matched, and why we check it starts with rather than the exact string, see the MB. + # Changelog * Sept 27, 2019 - Revision #1 (by Michael Nitschinger) @@ -201,6 +220,8 @@ class AnalyticsWarning { * Correct `AnalyticsStatus` enum values. * April 30, 2025 - Revision #3 (by Dimitris Christodoulou) * Allow setting both positional and named parameters. +* June 19, 2025 - Revision #4 (by Graham Pople) + * Add check for operational cluster. # Signoff