Skip to content

Update 0057-sdk3-analytics.md #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions rfc/0057-sdk3-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down