Skip to content

Commit c97369d

Browse files
authored
Deprecate AllowInconsistent (#537)
1 parent 867dff9 commit c97369d

File tree

7 files changed

+22
-62
lines changed

7 files changed

+22
-62
lines changed

.travis.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
sudo: required
1+
# Ubuntu 20.04 (Focal Fossa)
2+
dist: focal
23

3-
addons:
4-
apt:
5-
packages:
6-
- docker-ce
4+
sudo: required
75

86
before_install:
7+
- docker version
98
- |
109
mkdir -p $HOME/resources
1110
for i in {0..3}
@@ -27,9 +26,12 @@ before_install:
2726
travis_terminate 1
2827
fi
2928
29+
services:
30+
- docker
31+
3032
language: go
3133
go:
32-
- 1.20.6
34+
- 1.20.7
3335

3436
env:
3537
jobs:
@@ -43,8 +45,8 @@ env:
4345
- TEST_SUITE=run-v2-tests-cluster
4446
- TEST_SUITE=run-v2-tests-resilientsingle
4547
global:
46-
- ARANGODB=gcr.io/gcr-for-testing/arangodb/enterprise-preview:3.11.1
47-
- GOIMAGE=gcr.io/gcr-for-testing/golang:1.20.5
48+
- ARANGODB=gcr.io/gcr-for-testing/arangodb/enterprise-preview:3.11.2
49+
- GOIMAGE=gcr.io/gcr-for-testing/golang:1.20.7
4850
- ALPINE_IMAGE=gcr.io/gcr-for-testing/alpine:3.17
4951
- STARTER=arangodb/arangodb-starter:latest
5052
- TEST_DISALLOW_UNKNOWN_FIELDS=false

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [V2] Rename CreateCollectionOptions to CreateCollectionProperties
1919
- [V2] Add support for missing query options (create documents, remove collection, remove view)
2020
- [V2] Adjust CursorStats and JournalSize types
21+
- [V1] Deprecate `AllowInconsistent` in HotBackup
2122

2223
## [1.6.0](https://github.com/arangodb/go-driver/tree/v1.6.0) (2023-05-30)
2324
- Add ErrArangoDatabaseNotFound and IsExternalStorageError helper to v2

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SCRIPTDIR := $(shell pwd)
66
CURR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
77
ROOTDIR:=$(CURR)
88

9-
GOVERSION ?= 1.20.6
9+
GOVERSION ?= 1.20.7
1010
GOIMAGE ?= golang:$(GOVERSION)
1111
GOV2IMAGE ?= $(GOIMAGE)
1212
ALPINE_IMAGE ?= alpine:3.17

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

client_admin_backup.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
1717
//
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
20-
// Author Lars Maier
21-
//
2220

2321
package driver
2422

@@ -60,9 +58,12 @@ type BackupListOptions struct {
6058

6159
// BackupCreateOptions provides options for Create
6260
type BackupCreateOptions struct {
63-
Label string `json:"label,omitempty"`
64-
AllowInconsistent bool `json:"allowInconsistent,omitempty"`
65-
Timeout time.Duration `json:"timeout,omitempty"`
61+
Label string `json:"label,omitempty"`
62+
63+
Timeout time.Duration `json:"timeout,omitempty"`
64+
65+
// @deprecated - since 3.10.10 it exists only for backwards compatibility
66+
AllowInconsistent bool `json:"allowInconsistent,omitempty"`
6667
}
6768

6869
// BackupTransferStatus represents all possible states a transfer job can be in

test/backup_test.go

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -174,51 +174,6 @@ func TestBackupCreateWithLabel(t *testing.T) {
174174
}
175175
}
176176

177-
func TestBackupCreateWithAllowInconsistent(t *testing.T) {
178-
c := createClient(t, nil)
179-
skipIfNoBackup(c, t)
180-
181-
EnsureVersion(t, context.Background(), c).Enterprise().NotCluster().
182-
CheckVersion(BelowPatchRelease("3.7.2")).
183-
CheckVersion(BelowPatchRelease("3.6.6"))
184-
185-
var wg sync.WaitGroup
186-
defer func() {
187-
wg.Wait()
188-
}()
189-
b := c.Backup()
190-
dbname := "backup_db_test"
191-
colname := "backup_query_target"
192-
193-
// First create a long running transaction
194-
db := ensureDatabase(nil, c, dbname, nil, t)
195-
ensureCollection(nil, db, colname, nil, t)
196-
197-
wg.Add(1)
198-
go func() {
199-
defer wg.Done()
200-
if _, err := db.Query(nil, fmt.Sprintf("FOR i IN 1..15 INSERT {s:SLEEP(1)} INTO %s", colname), nil); err != nil {
201-
t.Fatalf("Failed to run query: %s", describe(err))
202-
}
203-
}()
204-
205-
time.Sleep(time.Second)
206-
207-
_, _, err := b.Create(nil, &driver.BackupCreateOptions{AllowInconsistent: false, Timeout: 3 * time.Second})
208-
if err == nil {
209-
t.Fatalf("Creating backup should fail but did not!")
210-
}
211-
212-
_, resp, err := b.Create(nil, &driver.BackupCreateOptions{AllowInconsistent: true, Timeout: 3 * time.Second})
213-
if err != nil {
214-
t.Fatalf("Failed to create backup: %s", describe(err))
215-
}
216-
217-
if !resp.PotentiallyInconsistent {
218-
t.Error("Expected PotentiallyInconsistent to be set to true, but it is not")
219-
}
220-
}
221-
222177
func TestBackupListWithID(t *testing.T) {
223178
c := createClient(t, nil)
224179
skipIfNoBackup(c, t)

v2/tests/utils_retry_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ import (
2828
"github.com/stretchr/testify/require"
2929
)
3030

31-
const defaultTestTimeout = 1 * time.Minute
31+
// defaultTestTimeout is the default timeout for context use in tests
32+
// less than 2 minutes is causing problems on CI
33+
const defaultTestTimeout = 2 * time.Minute
3234

3335
type Timeout func() error
3436

0 commit comments

Comments
 (0)