Skip to content
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

v2.3.1 #898

Merged
merged 6 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
psmdb: ["4.4", "5.0", "6.0"]
psmdb: ["4.4", "5.0", "6.0", "7.0"]
test: [logical, physical, incremental, external]
env:
PBM_BRANCH: ${{ github.event.inputs.pbm_branch || 'main' }}
Expand Down
63 changes: 63 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ pipeline {
runTest('New cluster', 'run-new-cluster', '6.0', 'logical')
}
}
stage('New cluster 7.0 logical') {
agent {
label 'docker'
}
steps {
prepareCluster('sharded', '70-newc-logic', '7.0')
runTest('New cluster', 'run-new-cluster', '7.0', 'logical')
}
}

stage('Sharded 4.4 logical') {
agent {
Expand Down Expand Up @@ -138,6 +147,15 @@ pipeline {
runTest('Sharded', 'run-sharded', '6.0', 'logical')
}
}
stage('Sharded 7.0 logical') {
agent {
label 'docker-32gb'
}
steps {
prepareCluster('sharded', '70-shrd-logic', '7.0')
runTest('Sharded', 'run-sharded', '7.0', 'logical')
}
}

stage('Non-sharded 4.4 logical') {
agent {
Expand Down Expand Up @@ -166,6 +184,15 @@ pipeline {
runTest('Non-sharded', 'run-rs', '6.0', 'logical')
}
}
stage('Non-sharded 7.0 logical') {
agent {
label 'docker'
}
steps {
prepareCluster('rs', '70-rs-logic', '7.0')
runTest('Non-sharded', 'run-rs', '7.0', 'logical')
}
}

stage('Single-node 4.4 logical') {
agent {
Expand Down Expand Up @@ -194,6 +221,15 @@ pipeline {
runTest('Single-node', 'run-single', '6.0', 'logical')
}
}
stage('Single-node 7.0 logical') {
agent {
label 'docker'
}
steps {
prepareCluster('single', '70-single-logic', '7.0')
runTest('Single-node', 'run-single', '7.0', 'logical')
}
}

stage('Sharded 4.4 physical') {
agent {
Expand Down Expand Up @@ -222,6 +258,15 @@ pipeline {
runTest('Sharded', 'run-sharded', '6.0', 'physical')
}
}
stage('Sharded 7.0 physical') {
agent {
label 'docker-32gb'
}
steps {
prepareCluster('sharded', '70-shrd-phys', '7.0')
runTest('Sharded', 'run-sharded', '7.0', 'physical')
}
}

stage('Non-sharded 4.4 physical') {
agent {
Expand Down Expand Up @@ -250,6 +295,15 @@ pipeline {
runTest('Non-sharded', 'run-rs', '6.0', 'physical')
}
}
stage('Non-sharded 7.0 physical') {
agent {
label 'docker'
}
steps {
prepareCluster('rs', '70-rs-phys', '7.0')
runTest('Non-sharded', 'run-rs', '7.0', 'physical')
}
}

stage('Single-node 4.4 physical') {
agent {
Expand Down Expand Up @@ -278,6 +332,15 @@ pipeline {
runTest('Single-node', 'run-single', '6.0', 'physical')
}
}
stage('Single-node 7.0 physical') {
agent {
label 'docker'
}
steps {
prepareCluster('single', '70-single-phys', '7.0')
runTest('Single-node', 'run-single', '7.0', 'physical')
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ func (a *Agent) HbStatus() {
} else {
hb.Hidden = inf.Hidden
hb.Passive = inf.Passive
hb.Arbiter = inf.ArbiterOnly
}
hb.Arbiter = inf.ArbiterOnly

err = a.pbm.SetAgentStatus(hb)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cli/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ func printCleanupInfoTo(w io.Writer, backups []pbm.BackupMeta, chunks []pbm.Oplo
}

lastWrite := &rs[len(rs)-1].End
if primitive.CompareTimestamp(*lastWrite, c.StartTS) == -1 {
if lastWrite.Compare(c.StartTS) == -1 {
oplogRanges[c.RS] = append(rs, oplogRange{c.StartTS, c.EndTS})
continue
}
if primitive.CompareTimestamp(*lastWrite, c.EndTS) == -1 {
if lastWrite.Compare(c.EndTS) == -1 {
*lastWrite = c.EndTS
}
}
Expand Down
8 changes: 2 additions & 6 deletions cli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,7 @@ func connect(ctx context.Context, uri, hosts string) (*mongo.Client, error) {
curi.RawQuery = query.Encode()
curi.Host = host

conn, err := mongo.NewClient(options.Client().ApplyURI(curi.String()).SetAppName("pbm-status"))
if err != nil {
return nil, errors.Wrap(err, "create mongo client")
}
err = conn.Connect(ctx)
conn, err := mongo.Connect(ctx, options.Client().ApplyURI(curi.String()).SetAppName("pbm-status"))
if err != nil {
return nil, errors.Wrap(err, "connect")
}
Expand Down Expand Up @@ -724,7 +720,7 @@ func getPITRranges(cn *pbm.PBM, bcps []pbm.BackupMeta, rsMap map[string]string)
}

sort.Slice(bcps, func(i, j int) bool {
return primitive.CompareTimestamp(bcps[i].LastWriteTS, bcps[j].LastWriteTS) == -1
return bcps[i].LastWriteTS.Compare(bcps[j].LastWriteTS) == -1
})

var pr []pitrRange
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Run tests
Run all tests
```
$ MONGODB_VERSION=4.2 ./run-all
$ MONGODB_VERSION=4.4 ./run-all
```
`MONGODB_VERSION` is a PSMDB version (e.g. 4.0/4.2/4.4). Default is `4.2`
`MONGODB_VERSION` is a PSMDB version (e.g. 4.4/5.0/6.0). Default is `4.4`

`./run-all` would run all tests both on a sharded cluster and a non-sharded replica set.

Expand All @@ -22,7 +22,7 @@ To start tests with a running pbm-agent and minio storage:
```
$ MONGODB_VERSION=4.4 ./start-cluster
```
`MONGODB_VERSION` is a PSMDB version (e.g. 4.0/4.2/4.4). Default is `4.2`
`MONGODB_VERSION` is a PSMDB version (e.g. 4.4/5.0/6.0). Default is `4.4`

`./start-replset` - to start a non-sharded replica set.

Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/cmd/ensure-oplog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,23 +358,23 @@ func findChunkRanges(rs []pbm.OplogChunk, from, till primitive.Timestamp) []time
rv := []timerange{}

c := rs[0]
if primitive.CompareTimestamp(from, c.StartTS) == -1 {
if from.Compare(c.StartTS) == -1 {
rv = append(rv, timerange{from, c.StartTS})
}

endTS := c.EndTS
for _, c = range rs[1:] {
if primitive.CompareTimestamp(endTS, c.StartTS) == -1 {
if endTS.Compare(c.StartTS) == -1 {
rv = append(rv, timerange{endTS, c.StartTS})
}
if primitive.CompareTimestamp(till, c.EndTS) != 1 {
if till.Compare(c.EndTS) != 1 {
return rv
}

endTS = c.EndTS
}

if primitive.CompareTimestamp(endTS, till) == -1 {
if endTS.Compare(till) == -1 {
rv = append(rv, timerange{endTS, till})
}

Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/docker/docker-compose-remapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
dockerfile: ./e2e-tests/docker/mongodb-rs/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
hostname: rs101
labels:
Expand Down Expand Up @@ -55,7 +55,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
Expand All @@ -70,7 +70,7 @@ services:
dockerfile: ./e2e-tests/docker/mongodb-rs/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
hostname: rs201
labels:
Expand Down Expand Up @@ -100,7 +100,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
Expand Down
16 changes: 8 additions & 8 deletions e2e-tests/docker/docker-compose-rs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
Expand All @@ -42,7 +42,7 @@ services:
dockerfile: ./e2e-tests/docker/mongodb-rs/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
hostname: rs101
labels:
Expand All @@ -52,7 +52,7 @@ services:
- MONGO_USER=dba
- BACKUP_USER=bcp
- MONGO_PASS=test1234
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
command: mongod --replSet rs1 --directoryperdb --port 27017 --dbpath=/data/db/ --storageEngine wiredTiger --keyFile /opt/keyFile --wiredTigerCacheSizeGB 1
volumes:
- data-rs101:/data/db
Expand All @@ -62,7 +62,7 @@ services:
dockerfile: ./e2e-tests/docker/mongodb-rs/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
hostname: rs102
labels:
Expand All @@ -75,7 +75,7 @@ services:
dockerfile: ./e2e-tests/docker/mongodb-rs/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
hostname: rs103
labels:
Expand All @@ -99,7 +99,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
Expand All @@ -124,7 +124,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
command: pbm-agent
cap_add:
Expand All @@ -148,7 +148,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
command: pbm-agent
cap_add:
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/docker/docker-compose-single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
dockerfile: ./e2e-tests/docker/mongodb-rs/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
hostname: rs101
labels:
Expand All @@ -36,7 +36,7 @@ services:
- BACKUP_USER=bcp
- MONGO_PASS=test1234
- SINGLE_NODE=true
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
command: mongod --replSet rs1 --port 27017 --storageEngine wiredTiger --keyFile /opt/keyFile --wiredTigerCacheSizeGB 1
volumes:
- data-rs101:/data/db
Expand All @@ -56,7 +56,7 @@ services:
dockerfile: ./e2e-tests/docker/pbm-agent/Dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-4.2}
- MONGODB_VERSION=${MONGODB_VERSION:-4.4}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
Expand Down
Loading
Loading