Skip to content

Commit 4b96e96

Browse files
authored
CBG-5500 remove unused UseXattrs/KvTLSPort from BucketSpec (#8390)
1 parent 1594379 commit 4b96e96

7 files changed

Lines changed: 6 additions & 31 deletions

File tree

base/bucket.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ type BucketSpec struct {
116116
Auth AuthHandler
117117
Certpath, Keypath, CACertPath string // X.509 auth parameters
118118
TLSSkipVerify bool // Use insecureSkipVerify when secure scheme (couchbases) is used and cacertpath is undefined
119-
KvTLSPort int // Port to use for memcached over TLS. Required for cbdatasource auth when using TLS
120-
UseXattrs bool // Whether to use xattrs to store _sync metadata. Used during view initialization
121119
ViewQueryTimeoutSecs *uint32 // the view query timeout in seconds (default: 75 seconds)
122120
MaxConcurrentQueryOps *int // maximum number of concurrent query operations (default: DefaultMaxConcurrentQueryOps)
123121
BucketOpTimeout *time.Duration // How long bucket ops should block returning "operation timed out". If nil, uses GoCB default. GoCB buckets only.
@@ -302,16 +300,6 @@ func GetBucket(ctx context.Context, spec BucketSpec) (bucket Bucket, err error)
302300
if err != nil {
303301
return nil, err
304302
}
305-
306-
// If XATTRS are enabled via enable_shared_bucket_access config flag, assert that Couchbase Server is 5.0
307-
// or later, otherwise refuse to connect to the bucket since pre 5.0 versions don't support XATTRs
308-
if spec.UseXattrs {
309-
if !bucket.IsSupported(sgbucket.BucketStoreFeatureXattrs) {
310-
WarnfCtx(ctx, "If using XATTRS, Couchbase Server version must be >= 5.0.")
311-
return nil, ErrFatalBucketConnection
312-
}
313-
}
314-
315303
}
316304

317305
// TODO: CBG-2529 - LoggingBucket has been removed - pending a new approach to logging all bucket operations

base/leaky_datastore.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ func (lds *LeakyDataStore) GetSpec() BucketSpec {
393393
// Return a minimal struct:
394394
return BucketSpec{
395395
BucketName: lds.bucket.GetName(),
396-
UseXattrs: true,
397396
}
398397
}
399398
}

base/main_test_bucket_pool_util.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func getTestBucketSpec(clusterSpec CouchbaseClusterSpec, testBucketName tbpBucke
5353
Username: clusterSpec.Username,
5454
Password: TestClusterPassword(),
5555
},
56-
UseXattrs: TestUseXattrs(),
5756
BucketName: string(testBucketName),
5857
TLSSkipVerify: clusterSpec.TLSSkipVerify,
5958
// use longer timeout than DefaultBucketOpTimeout to avoid timeouts in test harness from using buckets after flush, which takes some time to reinitialize

docs/api/components/schemas.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,10 +1317,6 @@ Database:
13171317
keypath:
13181318
description: The key path (private key) for X.509 bucket auth
13191319
type: string
1320-
kv_tls_port:
1321-
description: The Memcached TLS port.
1322-
type: integer
1323-
default: 11207
13241320
local_doc_expiry_secs:
13251321
description: The number of seconds before a `_local` document should expire.
13261322
type: integer
@@ -1808,6 +1804,11 @@ Database:
18081804
enum:
18091805
- DCP
18101806
deprecated: true
1807+
kv_tls_port:
1808+
description: The Memcached TLS port. This value is ignored, a port has to be specified in the connection string.
1809+
deprecated: true
1810+
type: integer
1811+
default: 11207
18111812
num_index_replicas:
18121813
description: |-
18131814
**Deprecated, please use the database setting `index.num_replicas` instead**

rest/config.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type BucketConfig struct {
103103
CertPath string `json:"certpath,omitempty"` // Cert path (public key) for X.509 bucket auth
104104
KeyPath string `json:"keypath,omitempty"` // Key path (private key) for X.509 bucket auth
105105
CACertPath string `json:"cacertpath,omitempty"` // Root CA cert path for X.509 bucket auth
106-
KvTLSPort int `json:"kv_tls_port,omitempty"` // Memcached TLS port, if not default (11207)
106+
KvTLSPort int `json:"kv_tls_port,omitempty"` // Deprecated: this has no effect and is present for compatibility with older database configs.
107107
MaxConcurrentQueryOps *int `json:"max_concurrent_query_ops,omitempty"` // Max concurrent query ops
108108
}
109109

@@ -112,7 +112,6 @@ func (dc *DbConfig) MakeBucketSpec(server string) base.BucketSpec {
112112
bc := &dc.BucketConfig
113113

114114
bucketName := ""
115-
tlsPort := 11207
116115

117116
// treat all walrus: as in memory storage, any persistent storage would have to be converted to rosmar
118117
if strings.HasPrefix(server, "walrus:") {
@@ -123,17 +122,12 @@ func (dc *DbConfig) MakeBucketSpec(server string) base.BucketSpec {
123122
bucketName = *bc.Bucket
124123
}
125124

126-
if bc.KvTLSPort != 0 {
127-
tlsPort = bc.KvTLSPort
128-
}
129-
130125
return base.BucketSpec{
131126
Server: server,
132127
BucketName: bucketName,
133128
Keypath: bc.KeyPath,
134129
Certpath: bc.CertPath,
135130
CACertPath: bc.CACertPath,
136-
KvTLSPort: tlsPort,
137131
Auth: bc,
138132
MaxConcurrentQueryOps: bc.MaxConcurrentQueryOps,
139133
}

rest/server_context.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,6 @@ func GetBucketSpec(ctx context.Context, config *DatabaseConfig, serverConfig *St
686686
spec.ViewQueryTimeoutSecs = config.ViewQueryTimeoutSecs
687687
}
688688

689-
spec.UseXattrs = config.UseXattrs()
690-
if !spec.UseXattrs {
691-
base.WarnfCtx(ctx, "Running Sync Gateway without shared bucket access is deprecated. Recommendation: set enable_shared_bucket_access=true")
692-
}
693-
694689
if config.BucketOpTimeoutMs != nil {
695690
operationTimeout := time.Millisecond * time.Duration(*config.BucketOpTimeoutMs)
696691
spec.BucketOpTimeout = &operationTimeout

rest/server_context_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ func bucketConfigFromTestBucket(tb *base.TestBucket) BucketConfig {
221221
CertPath: tb.BucketSpec.Certpath,
222222
KeyPath: tb.BucketSpec.Keypath,
223223
CACertPath: tb.BucketSpec.CACertPath,
224-
KvTLSPort: tb.BucketSpec.KvTLSPort,
225224
}
226225
}
227226

0 commit comments

Comments
 (0)