write_affinity stores only replica counts in local region. The write_affinity_node_count has no effect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Hugo Kou |
Bug Description
While write_affinity enabled. According to document https:/
Proxy suppose to store 6 copies in local region for 3 replicas policy if `write_
The problem is proxy always issues 3 PUT requests to object server only instead of 6.
```
Server:Port Device 192.168.5.4:6008 d8
Server:Port Device 192.168.5.1:6000 d10
Server:Port Device 192.168.5.3:6009 d19
Server:Port Device 192.168.5.2:6007 d2 [Handoff]
Server:Port Device 192.168.5.1:6007 d12 [Handoff]
Server:Port Device 192.168.5.3:6007 d17 [Handoff]
Server:Port Device 192.168.5.4:6009 d9 [Handoff]
Server:Port Device 192.168.5.2:6008 d3 [Handoff]
Server:Port Device 192.168.5.3:6006 d16 [Handoff]
Server:Port Device 192.168.5.4:6007 d7 [Handoff]
Server:Port Device 192.168.5.1:6009 d14 [Handoff]
Server:Port Device 192.168.5.3:6008 d18 [Handoff]
```
The object only been stored to d2, d12, d10 with write_affinity enable no matter the number of write_affinity_
I also have same issue in 2.3.0.4.
Server:Port Device 192.168.200.22:6000 d2
Server:Port Device 192.168.200.21:6000 d4
Server:Port Device 192.168.200.21:6000 d5
Server:Port Device 192.168.200.22:6000 d1 [Handoff]
Server:Port Device 192.168.200.22:6000 d6 [Handoff]
Server:Port Device 192.168.200.22:6000 d3 [Handoff]
I added some print in code, proxy is try to prepare 6 local nodes for iterate connections, but proxy only issue 3 requests to object servers.
proxy-server: STDOUT: first_n_ local_nodes: [{'index': 0, 'replication_port': 6003, 'weight': 4.294967296, 'zone': 1, 'ip': '192.168.200.22', 'region': 1, 'id': 2, 'replication_ip': '192.168.200.22', 'device': 'd2', 'port': 6000}, {'index': 1, 'replication_port': 6003, 'weight': 4.294967296, 'zone': 1, 'ip': '192.168.200.21', 'region': 1, 'id': 4, 'replication_ip': '192.168.200.21', 'device': 'd4', 'port': 6000}, {'index': 2, 'replication_port': 6003, 'weight': 4.294967296, 'zone': 1, 'ip': '192.168.200.21', 'region': 1, 'id': 5, 'replication_ip': '192.168.200.21', 'device': 'd5', 'port': 6000}, {'replication_ port': 6003, 'zone': 1, 'weight': 4.294967296, 'ip': '192.168.200.22', 'region': 1, 'port': 6000, 'replication_ip': '192.168.200.22', 'device': 'd1', 'id': 1}, {'replication_ port': 6003, 'zone': 1, 'weight': 4.294967296, 'ip': '192.168.200.22', 'region': 1, 'port': 6000, 'replication_ip': '192.168.200.22', 'device': 'd6', 'id': 6}, {'replication_ port': 6003, 'zone': 1, 'weight': 4.294967296, 'ip': '192.168.200.22', 'region': 1, 'port': 6000, 'replication_ip': '192.168.200.22', 'device': 'd3', 'id': 3}] (txn: tx7a9f39be92584 176b8990- 00568bc8a2) (client_ip: 192.168.200.100) 176b8990- 00568bc8a2) (client_ip: 192.168.200.100) 176b8990- 00568bc8a2) (client_ip: 192.168.200.100) 2016/13/ 44/02 PUT /v1/AUTH_ demo/test/ rc.s3212232 HTTP/1.0 201 - python- swiftclient- 2.3.1.post27 demo%2CAUTH_ tk1ab6. .. 82 - - tx7a9f39be92584 176b8990- 00568bc8a2 - 0.1556 - - 1452001442. 022504091 1452001442. 178122997 0
proxy-server: STDOUT: min_conns: 2 , nodes: 3 (txn: tx7a9f39be92584
proxy-server: STDOUT: statuses: [201, 201, 201], reasons: ['Created', 'Created', 'Created'] (txn: tx7a9f39be92584
proxy-server: 192.168.200.100 192.168.200.100 05/Jan/