coreos / torus

Torus Distributed Storage
https://coreos.com/blog/torus-distributed-storage-by-coreos.html
Apache License 2.0
1.78k stars 172 forks source link

Size of storage node is not changed after restarted with size update #342

Closed nak3 closed 7 years ago

nak3 commented 7 years ago

Reproduce steps

1. start torusd with --size=1GiB

$ sudo ./bin/torusd --peer-address=http://192.168.121.169:4000 --size=1GiB

$ ./bin/torusctl peer list
ADDRESS                      UUID                                  SIZE     USED  MEMBER  UPDATED       REB/REP DATA
http://192.168.121.169:4000  c6750e97-84b7-11e6-9369-525400473d96  1.0 GiB  0 B   Avail   1 second ago  0 B/sec
Balanced: true Usage:  0.00%

2. Stop torusd

^C
Received an interrupt, stopping services...

$ ./bin/torusctl peer remove c6750e97-84b7-11e6-9369-525400473d96 --force 
couldn't remove peer from ring: torus: doesn't exist

$ ./bin/torusctl peer list
ADDRESS  UUID  SIZE  USED  MEMBER  UPDATED  REB/REP DATA
Balanced: true Usage:   NaN%

3. Start torusd with another (e.g size --size=10GiB)

$ sudo ./bin/torusd --peer-address=http://192.168.121.169:4000 --size=10GiB

Actual result

[vagrant@torus1 torus]$ ./bin/torusctl peer list
ADDRESS                      UUID                                  SIZE     USED  MEMBER  UPDATED       REB/REP DATA
http://192.168.121.169:4000  c6750e97-84b7-11e6-9369-525400473d96  1.0 GiB  0 B   Avail   1 second ago  0 B/sec
Balanced: true Usage:  0.00%

Expect result

lethe3000 commented 7 years ago

I think it's the issue that --data-dir specified the directory for torus holding data. torus created a file with size specified by --size. Even when you changed --size value, the placeholder file size remains older size, I think maybe torusd did not increase placeholder file size on disk. If you clear data-dir and restart torusd, you can see the size is updated.