docker-archive / classicswarm

Swarm Classic: a container clustering system. Not to be confused with Docker Swarm which is at https://github.com/docker/swarmkit
Apache License 2.0
5.75k stars 1.08k forks source link

task-history-limit flag doesn't work #2888

Closed mmpyro closed 4 years ago

mmpyro commented 6 years ago

Problem: I have updated all nodes in cluster using "docker swarm update --task-history-limit 2" but it doesn't work. I have observed that services still has default history-limit (5) when I used docker service ps . docker info shows valid value 2.

Expected behavior: Only two additional services are keep in history when task-hisotry-limit was set to 2. When service is updated and number of services are greater than task-history-limit the oldest are removed.

Environment: Two node cluster (The same behavior for one node). Docker version 18.06.0-ce, build 0ffa825 Service deployed using "docker stack deploy --compose-file docker-compose.yml " Compose version in file "3.1" OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenial

output from docker info: Containers: 36 Running: 13 Paused: 0 Stopped: 23 Images: 30 Server Version: 18.06.0-ce Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 177 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: active NodeID: 9le2bq7bdo67ch5naatib4m8w Is Manager: true ClusterID: 9lrgnfom2wwhnxvcfj3p4hr85 Managers: 2 Nodes: 2 Orchestration: Task History Retention Limit: 2 Raft: Snapshot Interval: 10000 Number of Old Snapshots to Retain: 0 Heartbeat Tick: 1 Election Tick: 10 Dispatcher: Heartbeat Period: 5 seconds CA Configuration: Expiry Duration: 3 months Force Rotate: 0 Autolock Managers: false Root Rotation In Progress: false Node Address: 10.0.0.6 Manager Addresses: 10.0.0.6:2377 10.0.0.7:2377 Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: d64c661f1d51c48782c9cec8fda7604785f93587 runc version: 69663f0bd4b60df09991c08812a60108003fa340 init version: fec3683 Security Options: apparmor seccomp Profile: default Kernel Version: 4.15.0-1018-azure Operating System: Ubuntu 16.04.5 LTS OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 7.791GiB Name: elmodisde000002 ID: MZXA:7LT3:25QU:MNZW:EZBC:CVMC:35ZY:IHDC:U2SK:ZST3:UU4Q:HVST Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

Example service history:

ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS labgq8s9ci4f reportsreportscleaner.1 elmoacr.azurecr.io/reports-service:7140 elmodisde000002 Running Running 6 hours ago vd2gdemy0oul \ reportsreportscleaner.1 elmoacr.azurecr.io/reports-service:7124 elmodisde000002 Shutdown Shutdown 6 hours ago tei3rb52l653 \ reportsreportscleaner.1 elmoacr.azurecr.io/reports-service:7024 elmodisde000002 Shutdown Shutdown 25 hours ago u898xmyt2c23 \ reportsreportscleaner.1 elmoacr.azurecr.io/reports-service:7011 elmodisde000002 Shutdown Shutdown 3 days ago oj6y9u5ws4n2 \ reportsreportscleaner.1 elmoacr.azurecr.io/reports-service:6954 elmodisde000002 Shutdown Shutdown 3 days ago v9msjfqolcfe \ reports_reportscleaner.1 elmoacr.azurecr.io/reports-service:6928 elmodisde000002 Shutdown Shutdown 7 days ago