Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

*: support Writer with context #1910

Merged
merged 2 commits into from
Feb 6, 2018

Conversation

fanminshi
Copy link
Contributor

@fanminshi fanminshi commented Feb 6, 2018

backup/writer interface now reasons about input context. The context controls the writer.Write operation.

ref: #1906

@fanminshi
Copy link
Contributor Author

cc/ @hongchaodeng @hasbro17

@xiang90
Copy link
Collaborator

xiang90 commented Feb 6, 2018

/cc @rjtsdl for abs changes.

@hongchaodeng
Copy link
Member

LGTM for S3 part.
@rjtsdl Can you help implement the ABS part for context support?

@hongchaodeng
Copy link
Member

@fanminshi
Can you try the manual test:

  • set up 1s timeout and have large snapshot and expect it to fail due to timeout.
  • increase timeout to something larger then make it succeed.

@fanminshi
Copy link
Contributor Author

@hongchaodeng that was my plan for the 4th bullet point #1906

@rjtsdl
Copy link
Contributor

rjtsdl commented Feb 6, 2018

@hongchaodeng yep, i can help on ABS ctx support. Do we want it in this PR? Or I can create a new one.

@fanminshi
Copy link
Contributor Author

@rjtsdl let's support abs ctx in a new pr.

@fanminshi
Copy link
Contributor Author

Manual test plan

Case: 1 second backup timeout

etcd size:

$ bin/etcdctl --endpoints=http://192.168.99.100:32379 endpoint status
http://192.168.99.100:32379, c257147bab1ca7cf, 3.2.13, 71 MB, false, 4, 51198, 0,

1 second timeout:

apiVersion: "etcd.database.coreos.com/v1beta2"
kind: "EtcdBackup"
metadata:
  name: example-cluster-backup
spec:
  etcdEndpoints: ['example-etcd-cluster-client:2379']
  storageType: S3
  backupPolicy:
    TimeoutInSecond: 1
  s3:
    path: jenkins-testing-operator/vault.etcd.backup
    awsSecret: aws

output:

time="2018-02-06T22:49:58Z" level=info msg="getMaxRev: endpoint example-etcd-cluster-client:2379 revision (52065)"
time="2018-02-06T22:49:59Z" level=error msg="error syncing etcd backup (backup/example-cluster-backup): failed to save snapshot (failed to write snapshot (MultipartUpload: upload multipart failed
	upload id: X1OsTyWaRuHqvD10V0DatRqrCkhdnbS_OXQEo0Uc0StSbNSgglRSFzHUsTOujJIik6Dex48U42akh01sj88f7ZYTxX4VfPgRtONWcJhRSnin1ws.Oakq4hcFyYN5fF7s
caused by: RequestCanceled: request context canceled
caused by: context deadline exceeded))" pkg=controller

Case: 100 seconds backup timeout

etcd size:

$ bin/etcdctl --endpoints=http://192.168.99.100:32379 endpoint status
http://192.168.99.100:32379, c257147bab1ca7cf, 3.2.13, 71 MB, false, 4, 51198, 0,

100 backup timeout:

apiVersion: "etcd.database.coreos.com/v1beta2"
kind: "EtcdBackup"
metadata:
  name: example-cluster-backup
spec:
  etcdEndpoints: ['example-etcd-cluster-client:2379']
  storageType: S3
  backupPolicy:
    TimeoutInSecond: 100
  s3:
    path: jenkins-testing-operator/vault.etcd.backup
    awsSecret: aws

output:

$ kubectl -n backup get etcdbackups.etcd.database.coreos.com example-cluster-backup -o yaml
apiVersion: etcd.database.coreos.com/v1beta2
kind: EtcdBackup
metadata:
  clusterName: ""
  creationTimestamp: 2018-02-06T22:53:34Z
  generation: 0
  initializers: null
  name: example-cluster-backup
  namespace: backup
  resourceVersion: "155599"
  selfLink: /apis/etcd.database.coreos.com/v1beta2/namespaces/backup/etcdbackups/example-cluster-backup
  uid: 8f8d58d9-0b90-11e8-b6a1-080027ae9197
spec:
  backupPolicy:
    timeoutInSecond: 100
  etcdEndpoints:
  - example-etcd-cluster-client:2379
  s3:
    awsSecret: aws
    path: jenkins-testing-operator/vault.etcd.backup
  storageType: S3
status:
  etcdRevision: 52065
  etcdVersion: 3.2.13
  succeeded: true

@fanminshi
Copy link
Contributor Author

cc/ @hongchaodeng. Manually tested.

@hongchaodeng
Copy link
Member

LGTM

@hongchaodeng hongchaodeng merged commit 2e1eab0 into coreos:master Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants