updateCCVSettings performs a management query to determine the latest crossClusterVersioning and max cas settings.
(ctx context.Context)
| 1683 | |
| 1684 | // updateCCVSettings performs a management query to determine the latest crossClusterVersioning and max cas settings. |
| 1685 | func (db *DatabaseContext) updateCCVSettings(ctx context.Context) error { |
| 1686 | cbStore, ok := base.AsCouchbaseBucketStore(db.Bucket) |
| 1687 | if !ok { |
| 1688 | // for rosmar, ECCV is always enabled, mark starting cas as 0 |
| 1689 | db.CachedCCVEnabled.Store(true) |
| 1690 | for vbNo := range db.numVBuckets { |
| 1691 | db.CachedCCVStartingCas.Store(base.VBNo(vbNo), 0) |
| 1692 | } |
| 1693 | return nil |
| 1694 | } |
| 1695 | |
| 1696 | // Fetch from Couchbase Server |
| 1697 | enabled, maxCAS, err := cbStore.GetCCVSettings(ctx) |
| 1698 | if err != nil { |
| 1699 | return fmt.Errorf("Unable to retrieve server's CCV Starting CAS: %w", err) |
| 1700 | } |
| 1701 | |
| 1702 | db.CachedCCVEnabled.Store(enabled) |
| 1703 | if !enabled { |
| 1704 | db.CachedCCVStartingCas.Clear() |
| 1705 | } |
| 1706 | for vbNo, cas := range maxCAS { |
| 1707 | db.CachedCCVStartingCas.Store(vbNo, cas) |
| 1708 | } |
| 1709 | return nil |
| 1710 | } |
| 1711 | |
| 1712 | func (c *DatabaseCollection) updateAllPrincipalsSequences(ctx context.Context) error { |
| 1713 | users, roles, err := c.allPrincipalIDs(ctx) |
no test coverage detected