Checks whether a document has a mobile xattr. Used when running in non-xattr mode to support no downtime upgrade.
(ctx context.Context, key string, unmarshalLevel DocumentUnmarshalLevel)
| 3472 | |
| 3473 | // Checks whether a document has a mobile xattr. Used when running in non-xattr mode to support no downtime upgrade. |
| 3474 | func (c *DatabaseCollection) checkForUpgrade(ctx context.Context, key string, unmarshalLevel DocumentUnmarshalLevel) (*Document, *sgbucket.BucketDocument) { |
| 3475 | // If we are using xattrs or Couchbase Server doesn't support them, an upgrade isn't going to be in progress |
| 3476 | if c.UseXattrs() || !c.dataStore.IsSupported(sgbucket.BucketStoreFeatureXattrs) { |
| 3477 | return nil, nil |
| 3478 | } |
| 3479 | |
| 3480 | doc, rawDocument, err := c.GetDocWithXattrs(ctx, key, unmarshalLevel) |
| 3481 | if err != nil || doc == nil || !doc.HasValidSyncData() { |
| 3482 | return nil, nil |
| 3483 | } |
| 3484 | return doc, rawDocument |
| 3485 | } |
| 3486 | |
| 3487 | // legacyRevToHybridLogicalVector will take a legacy revID and convert it to a HybridLogicalVector, used for when a |
| 3488 | // document doesn't have hlv defined (it is a legacy pre upgraded doc). |
no test coverage detected