Triton-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
December 2014
- 2 participants
- 33 discussions
See <https://jenkins-ci.mcs.anl.gov/job/triton/133/>
------------------------------------------
[...truncated 1551 lines...]
# idx:3 node_id:::3347, virt_id:e8d0:30bc:e88e:55fb:cf83:74c5:c7:27db
# ring 48:
# idx:0 node_id:::3346, virt_id:1ffe:1c79:4a88:5657:16e6:482a:1729:c857
# idx:1 node_id:::3344, virt_id:307d:92a0:403c:6c93:dfb4:d21b:572b:19c1
# idx:2 node_id:::3345, virt_id:31af:e183:a1f9:c4d3:c016:75d1:7357:47d3
# idx:3 node_id:::3347, virt_id:efab:9b9c:c35b:5d5e:bf12:a948:5563:8207
# ring 49:
# idx:0 node_id:::3344, virt_id:5264:be20:239e:6e02:5cc2:b069:ecb5:5ace
# idx:1 node_id:::3347, virt_id:81ad:610a:8e54:290c:4970:6c26:7036:c1d0
# idx:2 node_id:::3346, virt_id:d54e:d730:e4ff:d07:d531:d74:f243:c7c3
# idx:3 node_id:::3345, virt_id:ec30:10d:7cba:2fca:423d:85c3:fefa:4100
# ring 50:
# idx:0 node_id:::3345, virt_id:65ed:3d4:861f:b48a:797c:2013:4a26:4367
# idx:1 node_id:::3346, virt_id:cc43:b9fc:a27d:8ac:7516:2a2e:89e4:b547
# idx:2 node_id:::3347, virt_id:e204:45b8:a05a:ed85:cea2:af09:b171:b43
# idx:3 node_id:::3344, virt_id:fd8d:9383:57da:17ad:5535:63fd:9006:a16
# ring 51:
# idx:0 node_id:::3346, virt_id:3c60:f04b:c1a5:1624:df1:f0c:414c:848c
# idx:1 node_id:::3345, virt_id:609f:b9cc:ee47:1de4:3c0a:afb8:651c:3a41
# idx:2 node_id:::3344, virt_id:86be:c60d:ac2d:ef7e:6ea8:50e8:1790:3069
# idx:3 node_id:::3347, virt_id:fb89:a8d5:f704:34d0:cf74:3206:9bd9:30a1
# ring 52:
# idx:0 node_id:::3345, virt_id:1f25:68e6:479e:19cf:908e:e665:a862:9c89
# idx:1 node_id:::3347, virt_id:4aaf:c2ad:1799:26cb:64a0:d600:b4de:c1d0
# idx:2 node_id:::3344, virt_id:6d48:c159:2585:383d:33ce:e922:6b6:da1
# idx:3 node_id:::3346, virt_id:9662:73fe:5491:63bc:59f0:33ff:4cd3:ce93
# ring 53:
# idx:0 node_id:::3346, virt_id:11b0:1d3:2a3:75a3:8171:fe1f:1996:ce28
# idx:1 node_id:::3347, virt_id:41a1:6f07:3df4:a1b7:f44d:64fe:7769:9b07
# idx:2 node_id:::3344, virt_id:4964:de1d:c1cb:47f0:6222:d154:628d:87f0
# idx:3 node_id:::3345, virt_id:5467:f42b:a5a:6b1a:8b0f:1d49:8cb3:acfc
# ring 54:
# idx:0 node_id:::3344, virt_id:e91:f217:cc4b:4ed6:fbd9:8e4a:14be:dca7
# idx:1 node_id:::3347, virt_id:2b22:2fa2:a699:1bb2:117c:853f:a56:1153
# idx:2 node_id:::3345, virt_id:341d:fb00:ff3:3354:2b80:e7fa:a4ea:fcc8
# idx:3 node_id:::3346, virt_id:43a9:f1d0:df33:6692:2d3a:d612:398a:74a6
# ring 55:
# idx:0 node_id:::3345, virt_id:119:f46a:c040:119f:6256:93bf:c3d5:780e
# idx:1 node_id:::3346, virt_id:680a:6d4e:1934:555c:babe:ad32:b1e8:cf66
# idx:2 node_id:::3347, virt_id:75ad:236:808b:1fc0:e07c:70c7:d2e1:37fb
# idx:3 node_id:::3344, virt_id:fd3f:3ab0:ba81:c874:18a7:1c2a:1f11:cf93
# ring 56:
# idx:0 node_id:::3346, virt_id:1710:f045:e1ba:78db:5ffb:8aa0:341:a980
# idx:1 node_id:::3345, virt_id:1d19:fd1d:808b:93b0:ff92:806e:bc41:3b98
# idx:2 node_id:::3344, virt_id:d4c0:7f2a:1ae:f9e1:2ef8:6225:733e:cede
# idx:3 node_id:::3347, virt_id:fabe:d9e5:3b77:efd9:e03f:6474:1072:35ed
# ring 57:
# idx:0 node_id:::3347, virt_id:197b:605e:83b9:796c:2761:4ac3:5bab:8eb6
# idx:1 node_id:::3346, virt_id:9c57:bb5:5a47:59fd:7829:4368:4c6b:b162
# idx:2 node_id:::3345, virt_id:bdab:2a41:a673:dffc:623e:4893:2bab:6366
# idx:3 node_id:::3344, virt_id:cba8:8ba2:861d:cf70:b120:8d12:b759:6978
# ring 58:
# idx:0 node_id:::3347, virt_id:45d:962f:d7ac:30e9:a39e:65b8:bad7:d44f
# idx:1 node_id:::3345, virt_id:b8f:76c9:6b61:1d6c:109f:42d3:fc83:c9f0
# idx:2 node_id:::3344, virt_id:480a:ef66:5bee:5840:9f73:99e:fc87:8fb9
# idx:3 node_id:::3346, virt_id:97a6:b79a:26e1:69c4:d653:9149:7c56:e018
# ring 59:
# idx:0 node_id:::3347, virt_id:4d76:ba39:79b4:7468:2d66:2171:42a0:8a85
# idx:1 node_id:::3344, virt_id:b639:aa85:8484:39c:5062:66a1:3118:8d74
# idx:2 node_id:::3346, virt_id:d635:e835:ea38:4bba:7a70:30c4:8fe3:22b0
# idx:3 node_id:::3345, virt_id:f85b:1272:b717:5808:e613:333b:cab4:5f73
# ring 60:
# idx:0 node_id:::3347, virt_id:317b:ec62:5380:f924:44ad:a462:215c:b275
# idx:1 node_id:::3344, virt_id:59ed:5124:d223:c50c:ba1:3b68:ded5:218b
# idx:2 node_id:::3346, virt_id:b25c:c1ea:ca66:c61e:f432:b0aa:80bc:9098
# idx:3 node_id:::3345, virt_id:d042:dfbf:4075:964e:e069:6ff5:ee9b:aa2a
# ring 61:
# idx:0 node_id:::3344, virt_id:44b:1132:2609:3639:98e7:4e80:5232:f759
# idx:1 node_id:::3345, virt_id:3c3d:5b99:185f:9ce2:4e7b:18f8:5888:9852
# idx:2 node_id:::3346, virt_id:4dbf:b379:2e38:9246:b60d:b9d3:f36f:8ba5
# idx:3 node_id:::3347, virt_id:bd89:50ec:c081:3346:91b4:ee6b:e5b0:c90a
# ring 62:
# idx:0 node_id:::3347, virt_id:6b5a:cbfb:520e:a2cc:1b36:ee73:7ec2:d998
# idx:1 node_id:::3344, virt_id:8252:7d3e:8a56:f8b:512a:3a4d:7324:92f1
# idx:2 node_id:::3346, virt_id:8bbc:75ce:f5e4:257c:17bb:c2fc:3973:da68
# idx:3 node_id:::3345, virt_id:b7e6:af63:610f:8d71:db91:3aaf:a979:8030
# ring 63:
# idx:0 node_id:::3347, virt_id:15db:fee0:2bb5:8384:d66:411c:a111:f4b0
# idx:1 node_id:::3344, virt_id:9de2:7ce6:c4a8:9139:89bb:412a:c345:f3f7
# idx:2 node_id:::3346, virt_id:cbb3:b315:373a:d8eb:1fb2:f1fb:251e:6c0a
# idx:3 node_id:::3345, virt_id:dcbb:6818:1199:7b87:1011:4bf6:70e4:136f
# oid ::123 mapped to ring 35
# oid ::123 mapped 0 replica to node ::3344
# oid ::123 mapped 1 replica to node ::3347
# oid ::123 mapped 2 replica to node ::3345
PASS: tests/triton-show-placement.sh
enosys example: base:Not implemented
wrapped enosys example: :::stacked msg level 2, :::stacked msg level 1, :::stacked msg level 0, base:Not implemented
PASS: tests/common/test-triton-ret-t
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::7fff:ffff:ffff:fffc:
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
::1
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::bfff:ffff:ffff:fffa:
::bfff:ffff:ffff:fffd
::1
::3fff:ffff:ffff:ffff
PASS: tests/placement/test-placement-1d.sh
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::7fff:ffff:ffff:fffc:
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
::3fff:ffff:ffff:ffff
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::bfff:ffff:ffff:fffa:
::7fff:ffff:ffff:ffff
::3fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
PASS: tests/placement/test-placement-mrh.sh
tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-nvJwVc>
PASS: tests/common/test-debug.sh
serialized: <::1><testkey><bar>,<::2><testkey><foo>,<::1><testkeyB><foo>,<::2><testkeyB><foo>
node1 testkeyB value: foo
node_list[0]: ::1
node_list[1]: ::2
PASS: tests/system-state/test-system-state
+ '[' -z <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code> ']'
+ source <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code/tests/test-util.sh>
++ '[' -n <https://jenkins-ci.mcs.anl.gov/job/triton/ws/> ']'
++ TMPDIR=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
++ export TMPDIR
++ mkdir -p <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
+++ mktemp --tmpdir -d test-XXXXXX
++ TMPBASE=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD>
++ echo 'tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD'>
tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD>
++ '[' '!' -d <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD> ']'
+ test_start_servers 1 5 60 1
+ nservers=1
+ startwait=5
+ maxtime=60s
+ repfactor=1
+ pid=5215
+ startport=3344
++ expr 3344 + 1 - 1
+ endport=3344
+ test_gen_conf
+ echo '# auto-generated configuration file from test pid 5215, 1 servers'
+ echo 'hosts = {'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ echo -e '"::3344 tcp://localhost:3344",'
+ echo '}'
+ echo 'triton_debug_file = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD/triton-s…'>
+ echo 'triton_tosd_db_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD/triton-s…'>
+ echo 'triton_tosd_data_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD/triton-s…'>
+ echo 'triton_debug_masks = "all"'
+ echo 'triton_tosd_flags = "DATA_SYNC"'
+ [[ 1 -gt 0 ]]
+ echo 'triton_rosd_default_replication_factor = 1'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ '[' 0 -ne 0 ']'
+ sleep 5
+ timeout --signal=9 60s src/server/triton-server --conf <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-2SboHD/triton-5…> --listenaddr tcp://localhost:3344
+ svr1=tcp://localhost:3344
+ run_to 60 tests/asg/test-asg-simple tcp://localhost:3344 555
+ maxtime=60s
+ shift
+ timeout --signal=9 60s tests/asg/test-asg-simple tcp://localhost:3344 555
+ '[' 0 -ne 0 ']'
+ run_to 60 src/admin-tools/triton-shutdown-all-servers tcp://localhost:3344
+ wait
+ exit 0
PASS: tests/asg/test-asg-simple.sh
+ '[' -z <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code> ']'
+ source <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code/tests/test-util.sh>
++ '[' -n <https://jenkins-ci.mcs.anl.gov/job/triton/ws/> ']'
++ TMPDIR=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
++ export TMPDIR
++ mkdir -p <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
+++ mktemp --tmpdir -d test-XXXXXX
++ TMPBASE=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq>
++ echo 'tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq'>
tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq>
++ '[' '!' -d <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq> ']'
+ test_start_servers 1 5 60 1
+ nservers=1
+ startwait=5
+ maxtime=60s
+ repfactor=1
+ pid=5499
+ startport=3344
++ expr 3344 + 1 - 1
+ endport=3344
+ test_gen_conf
+ echo '# auto-generated configuration file from test pid 5499, 1 servers'
+ echo 'hosts = {'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ echo -e '"::3344 tcp://localhost:3344",'
+ echo '}'
+ echo 'triton_debug_file = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq/triton-s…'>
+ echo 'triton_tosd_db_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq/triton-s…'>
+ echo 'triton_tosd_data_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq/triton-s…'>
+ echo 'triton_debug_masks = "all"'
+ echo 'triton_tosd_flags = "DATA_SYNC"'
+ [[ 1 -gt 0 ]]
+ echo 'triton_rosd_default_replication_factor = 1'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ '[' 0 -ne 0 ']'
+ sleep 5
+ timeout --signal=9 60s src/server/triton-server --conf <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-9HN8pq/triton-5…> --listenaddr tcp://localhost:3344
+ svr1=tcp://localhost:3344
+ run_to 60 tests/asg/test-asg-multi-init tcp://localhost:3344
+ maxtime=60s
+ shift
+ timeout --signal=9 60s tests/asg/test-asg-multi-init tcp://localhost:3344
+ '[' 0 -ne 0 ']'
+ run_to 60 src/admin-tools/triton-shutdown-all-servers tcp://localhost:3344
+ wait
+ exit 0
PASS: tests/asg/test-asg-multi-init.sh
==================================================================
2 of 23 tests failed
Please report to http://trac.mcs.anl.gov/projects/triton/newticket
==================================================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `<https://jenkins-ci.mcs.anl.gov/job/triton/ws/build/tritonbuild'>
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `<https://jenkins-ci.mcs.anl.gov/job/triton/ws/build/tritonbuild'>
make: *** [check] Error 2
Build step 'Execute shell' marked build as failure
TAP Reports Processing: START
Looking for TAP results report in workspace using pattern: build/tritonbuild/tests/results.tap
Did not find any matching files.
1
3
See <https://jenkins-ci.mcs.anl.gov/job/triton/131/>
------------------------------------------
[...truncated 1618 lines...]
# idx:3 node_id:::3347, virt_id:e8d0:30bc:e88e:55fb:cf83:74c5:c7:27db
# ring 48:
# idx:0 node_id:::3346, virt_id:1ffe:1c79:4a88:5657:16e6:482a:1729:c857
# idx:1 node_id:::3344, virt_id:307d:92a0:403c:6c93:dfb4:d21b:572b:19c1
# idx:2 node_id:::3345, virt_id:31af:e183:a1f9:c4d3:c016:75d1:7357:47d3
# idx:3 node_id:::3347, virt_id:efab:9b9c:c35b:5d5e:bf12:a948:5563:8207
# ring 49:
# idx:0 node_id:::3344, virt_id:5264:be20:239e:6e02:5cc2:b069:ecb5:5ace
# idx:1 node_id:::3347, virt_id:81ad:610a:8e54:290c:4970:6c26:7036:c1d0
# idx:2 node_id:::3346, virt_id:d54e:d730:e4ff:d07:d531:d74:f243:c7c3
# idx:3 node_id:::3345, virt_id:ec30:10d:7cba:2fca:423d:85c3:fefa:4100
# ring 50:
# idx:0 node_id:::3345, virt_id:65ed:3d4:861f:b48a:797c:2013:4a26:4367
# idx:1 node_id:::3346, virt_id:cc43:b9fc:a27d:8ac:7516:2a2e:89e4:b547
# idx:2 node_id:::3347, virt_id:e204:45b8:a05a:ed85:cea2:af09:b171:b43
# idx:3 node_id:::3344, virt_id:fd8d:9383:57da:17ad:5535:63fd:9006:a16
# ring 51:
# idx:0 node_id:::3346, virt_id:3c60:f04b:c1a5:1624:df1:f0c:414c:848c
# idx:1 node_id:::3345, virt_id:609f:b9cc:ee47:1de4:3c0a:afb8:651c:3a41
# idx:2 node_id:::3344, virt_id:86be:c60d:ac2d:ef7e:6ea8:50e8:1790:3069
# idx:3 node_id:::3347, virt_id:fb89:a8d5:f704:34d0:cf74:3206:9bd9:30a1
# ring 52:
# idx:0 node_id:::3345, virt_id:1f25:68e6:479e:19cf:908e:e665:a862:9c89
# idx:1 node_id:::3347, virt_id:4aaf:c2ad:1799:26cb:64a0:d600:b4de:c1d0
# idx:2 node_id:::3344, virt_id:6d48:c159:2585:383d:33ce:e922:6b6:da1
# idx:3 node_id:::3346, virt_id:9662:73fe:5491:63bc:59f0:33ff:4cd3:ce93
# ring 53:
# idx:0 node_id:::3346, virt_id:11b0:1d3:2a3:75a3:8171:fe1f:1996:ce28
# idx:1 node_id:::3347, virt_id:41a1:6f07:3df4:a1b7:f44d:64fe:7769:9b07
# idx:2 node_id:::3344, virt_id:4964:de1d:c1cb:47f0:6222:d154:628d:87f0
# idx:3 node_id:::3345, virt_id:5467:f42b:a5a:6b1a:8b0f:1d49:8cb3:acfc
# ring 54:
# idx:0 node_id:::3344, virt_id:e91:f217:cc4b:4ed6:fbd9:8e4a:14be:dca7
# idx:1 node_id:::3347, virt_id:2b22:2fa2:a699:1bb2:117c:853f:a56:1153
# idx:2 node_id:::3345, virt_id:341d:fb00:ff3:3354:2b80:e7fa:a4ea:fcc8
# idx:3 node_id:::3346, virt_id:43a9:f1d0:df33:6692:2d3a:d612:398a:74a6
# ring 55:
# idx:0 node_id:::3345, virt_id:119:f46a:c040:119f:6256:93bf:c3d5:780e
# idx:1 node_id:::3346, virt_id:680a:6d4e:1934:555c:babe:ad32:b1e8:cf66
# idx:2 node_id:::3347, virt_id:75ad:236:808b:1fc0:e07c:70c7:d2e1:37fb
# idx:3 node_id:::3344, virt_id:fd3f:3ab0:ba81:c874:18a7:1c2a:1f11:cf93
# ring 56:
# idx:0 node_id:::3346, virt_id:1710:f045:e1ba:78db:5ffb:8aa0:341:a980
# idx:1 node_id:::3345, virt_id:1d19:fd1d:808b:93b0:ff92:806e:bc41:3b98
# idx:2 node_id:::3344, virt_id:d4c0:7f2a:1ae:f9e1:2ef8:6225:733e:cede
# idx:3 node_id:::3347, virt_id:fabe:d9e5:3b77:efd9:e03f:6474:1072:35ed
# ring 57:
# idx:0 node_id:::3347, virt_id:197b:605e:83b9:796c:2761:4ac3:5bab:8eb6
# idx:1 node_id:::3346, virt_id:9c57:bb5:5a47:59fd:7829:4368:4c6b:b162
# idx:2 node_id:::3345, virt_id:bdab:2a41:a673:dffc:623e:4893:2bab:6366
# idx:3 node_id:::3344, virt_id:cba8:8ba2:861d:cf70:b120:8d12:b759:6978
# ring 58:
# idx:0 node_id:::3347, virt_id:45d:962f:d7ac:30e9:a39e:65b8:bad7:d44f
# idx:1 node_id:::3345, virt_id:b8f:76c9:6b61:1d6c:109f:42d3:fc83:c9f0
# idx:2 node_id:::3344, virt_id:480a:ef66:5bee:5840:9f73:99e:fc87:8fb9
# idx:3 node_id:::3346, virt_id:97a6:b79a:26e1:69c4:d653:9149:7c56:e018
# ring 59:
# idx:0 node_id:::3347, virt_id:4d76:ba39:79b4:7468:2d66:2171:42a0:8a85
# idx:1 node_id:::3344, virt_id:b639:aa85:8484:39c:5062:66a1:3118:8d74
# idx:2 node_id:::3346, virt_id:d635:e835:ea38:4bba:7a70:30c4:8fe3:22b0
# idx:3 node_id:::3345, virt_id:f85b:1272:b717:5808:e613:333b:cab4:5f73
# ring 60:
# idx:0 node_id:::3347, virt_id:317b:ec62:5380:f924:44ad:a462:215c:b275
# idx:1 node_id:::3344, virt_id:59ed:5124:d223:c50c:ba1:3b68:ded5:218b
# idx:2 node_id:::3346, virt_id:b25c:c1ea:ca66:c61e:f432:b0aa:80bc:9098
# idx:3 node_id:::3345, virt_id:d042:dfbf:4075:964e:e069:6ff5:ee9b:aa2a
# ring 61:
# idx:0 node_id:::3344, virt_id:44b:1132:2609:3639:98e7:4e80:5232:f759
# idx:1 node_id:::3345, virt_id:3c3d:5b99:185f:9ce2:4e7b:18f8:5888:9852
# idx:2 node_id:::3346, virt_id:4dbf:b379:2e38:9246:b60d:b9d3:f36f:8ba5
# idx:3 node_id:::3347, virt_id:bd89:50ec:c081:3346:91b4:ee6b:e5b0:c90a
# ring 62:
# idx:0 node_id:::3347, virt_id:6b5a:cbfb:520e:a2cc:1b36:ee73:7ec2:d998
# idx:1 node_id:::3344, virt_id:8252:7d3e:8a56:f8b:512a:3a4d:7324:92f1
# idx:2 node_id:::3346, virt_id:8bbc:75ce:f5e4:257c:17bb:c2fc:3973:da68
# idx:3 node_id:::3345, virt_id:b7e6:af63:610f:8d71:db91:3aaf:a979:8030
# ring 63:
# idx:0 node_id:::3347, virt_id:15db:fee0:2bb5:8384:d66:411c:a111:f4b0
# idx:1 node_id:::3344, virt_id:9de2:7ce6:c4a8:9139:89bb:412a:c345:f3f7
# idx:2 node_id:::3346, virt_id:cbb3:b315:373a:d8eb:1fb2:f1fb:251e:6c0a
# idx:3 node_id:::3345, virt_id:dcbb:6818:1199:7b87:1011:4bf6:70e4:136f
# oid ::123 mapped to ring 35
# oid ::123 mapped 0 replica to node ::3344
# oid ::123 mapped 1 replica to node ::3347
# oid ::123 mapped 2 replica to node ::3345
PASS: tests/triton-show-placement.sh
enosys example: base:Not implemented
wrapped enosys example: :::stacked msg level 2, :::stacked msg level 1, :::stacked msg level 0, base:Not implemented
PASS: tests/common/test-triton-ret-t
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::7fff:ffff:ffff:fffc:
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
::1
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::bfff:ffff:ffff:fffa:
::bfff:ffff:ffff:fffd
::1
::3fff:ffff:ffff:ffff
PASS: tests/placement/test-placement-1d.sh
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::7fff:ffff:ffff:fffc:
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
::3fff:ffff:ffff:ffff
all servers:
::1
::3fff:ffff:ffff:ffff
::7fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
closest to OID: ::bfff:ffff:ffff:fffa:
::7fff:ffff:ffff:ffff
::3fff:ffff:ffff:ffff
::bfff:ffff:ffff:fffd
PASS: tests/placement/test-placement-mrh.sh
tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-jdzSP7>
PASS: tests/common/test-debug.sh
serialized: <::1><testkey><bar>,<::2><testkey><foo>,<::1><testkeyB><foo>,<::2><testkeyB><foo>
node1 testkeyB value: foo
node_list[0]: ::1
node_list[1]: ::2
PASS: tests/system-state/test-system-state
+ '[' -z <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code> ']'
+ source <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code/tests/test-util.sh>
++ '[' -n <https://jenkins-ci.mcs.anl.gov/job/triton/ws/> ']'
++ TMPDIR=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
++ export TMPDIR
++ mkdir -p <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
+++ mktemp --tmpdir -d test-XXXXXX
++ TMPBASE=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy>
++ echo 'tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy'>
tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy>
++ '[' '!' -d <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy> ']'
+ test_start_servers 1 5 60 1
+ nservers=1
+ startwait=5
+ maxtime=60s
+ repfactor=1
+ pid=14098
+ startport=3344
++ expr 3344 + 1 - 1
+ endport=3344
+ test_gen_conf
+ echo '# auto-generated configuration file from test pid 14098, 1 servers'
+ echo 'hosts = {'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ echo -e '"::3344 tcp://localhost:3344",'
+ echo '}'
+ echo 'triton_debug_file = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy/triton-s…'>
+ echo 'triton_tosd_db_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy/triton-s…'>
+ echo 'triton_tosd_data_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy/triton-s…'>
+ echo 'triton_debug_masks = "all"'
+ echo 'triton_tosd_flags = "DATA_SYNC"'
+ [[ 1 -gt 0 ]]
+ echo 'triton_rosd_default_replication_factor = 1'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ '[' 0 -ne 0 ']'
+ sleep 5
+ timeout --signal=9 60s src/server/triton-server --conf <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-Oijgvy/triton-1…> --listenaddr tcp://localhost:3344
+ svr1=tcp://localhost:3344
+ run_to 60 tests/asg/test-asg-simple tcp://localhost:3344 555
+ maxtime=60s
+ shift
+ timeout --signal=9 60s tests/asg/test-asg-simple tcp://localhost:3344 555
+ '[' 0 -ne 0 ']'
+ run_to 60 src/admin-tools/triton-shutdown-all-servers tcp://localhost:3344
+ wait
+ exit 0
PASS: tests/asg/test-asg-simple.sh
+ '[' -z <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code> ']'
+ source <https://jenkins-ci.mcs.anl.gov/job/triton/ws/code/tests/test-util.sh>
++ '[' -n <https://jenkins-ci.mcs.anl.gov/job/triton/ws/> ']'
++ TMPDIR=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
++ export TMPDIR
++ mkdir -p <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp>
+++ mktemp --tmpdir -d test-XXXXXX
++ TMPBASE=<https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9>
++ echo 'tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9'>
tmpbase: <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9>
++ '[' '!' -d <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9> ']'
+ test_start_servers 1 5 60 1
+ nservers=1
+ startwait=5
+ maxtime=60s
+ repfactor=1
+ pid=14430
+ startport=3344
++ expr 3344 + 1 - 1
+ endport=3344
+ test_gen_conf
+ echo '# auto-generated configuration file from test pid 14430, 1 servers'
+ echo 'hosts = {'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ echo -e '"::3344 tcp://localhost:3344",'
+ echo '}'
+ echo 'triton_debug_file = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9/triton-s…'>
+ echo 'triton_tosd_db_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9/triton-s…'>
+ echo 'triton_tosd_data_path = <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9/triton-s…'>
+ echo 'triton_debug_masks = "all"'
+ echo 'triton_tosd_flags = "DATA_SYNC"'
+ [[ 1 -gt 0 ]]
+ echo 'triton_rosd_default_replication_factor = 1'
++ seq 3344 3344
+ for i in '`seq $startport $endport`'
+ '[' 0 -ne 0 ']'
+ sleep 5
+ timeout --signal=9 60s src/server/triton-server --conf <https://jenkins-ci.mcs.anl.gov/job/triton/ws/tritontmp/test-gjtrD9/triton-1…> --listenaddr tcp://localhost:3344
+ svr1=tcp://localhost:3344
+ run_to 60 tests/asg/test-asg-multi-init tcp://localhost:3344
+ maxtime=60s
+ shift
+ timeout --signal=9 60s tests/asg/test-asg-multi-init tcp://localhost:3344
+ '[' 0 -ne 0 ']'
+ run_to 60 src/admin-tools/triton-shutdown-all-servers tcp://localhost:3344
+ wait
+ exit 0
PASS: tests/asg/test-asg-multi-init.sh
==================================================================
1 of 23 tests failed
Please report to http://trac.mcs.anl.gov/projects/triton/newticket
==================================================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `<https://jenkins-ci.mcs.anl.gov/job/triton/ws/build/tritonbuild'>
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `<https://jenkins-ci.mcs.anl.gov/job/triton/ws/build/tritonbuild'>
make: *** [check] Error 2
Build step 'Execute shell' marked build as failure
TAP Reports Processing: START
Looking for TAP results report in workspace using pattern: build/tritonbuild/tests/results.tap
Did not find any matching files.
1
1
branch, trac-323-sos, updated. 9618c386c795c7988fde6c72560856665c7eeba1
by noreply@mcs.anl.gov 23 Dec '14
by noreply@mcs.anl.gov 23 Dec '14
23 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via 9618c386c795c7988fde6c72560856665c7eeba1 (commit)
via 70ab5740e02b27a1f2b0ec388829bc1c7ecbd4d9 (commit)
from 7d7ea4ffa6f9f0027d1960cfee206d8fc2a337ae (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9618c386c795c7988fde6c72560856665c7eeba1
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Tue Dec 23 11:47:53 2014 -0600
modify rosd-read to be record-oriented
commit 70ab5740e02b27a1f2b0ec388829bc1c7ecbd4d9
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Tue Dec 23 09:13:19 2014 -0600
got rid of redundant oid_to_addr fns
-----------------------------------------------------------------------
Summary of changes:
code/src/admin-tools/triton-cp.ae | 10 +++-
code/src/asg/asg-internal.ae | 18 +++++-
code/src/remote/mercury-engine.hae | 25 +++-----
code/src/replicated-osd/rosd-create.ae | 4 +-
code/src/replicated-osd/rosd-internal.hae | 8 +--
code/src/replicated-osd/rosd-probe-fork.ae | 2 +-
code/src/replicated-osd/rosd-probe-object.ae | 2 +-
code/src/replicated-osd/rosd-read.ae | 54 +++++++++-------
code/src/replicated-osd/rosd-remove.ae | 4 +-
code/src/replicated-osd/rosd-reset.ae | 2 +-
code/src/replicated-osd/rosd-util.ae | 2 +-
code/src/replicated-osd/rosd-write.ae | 8 +-
code/src/replicated-osd/rosd.ae | 87 +-------------------------
code/src/replicated-osd/rosd.hae | 32 +++++++---
14 files changed, 103 insertions(+), 155 deletions(-)
Diff of changes:
diff --git a/code/src/admin-tools/triton-cp.ae b/code/src/admin-tools/triton-cp.ae
index 9e5cd29..5595360 100644
--- a/code/src/admin-tools/triton-cp.ae
+++ b/code/src/admin-tools/triton-cp.ae
@@ -278,6 +278,9 @@ static __blocking int tc_read(struct obj_ref* ref, char* buffer, int size)
triton_ret_t tret;
uint64_t txn_nr;
int64_t out_size;
+ struct rosd_record_info *rinfo = NULL;
+ uint64_t num_record_infos;
+
if(ref->type == TYPE_POSIX)
{
@@ -294,6 +297,9 @@ static __blocking int tc_read(struct obj_ref* ref, char* buffer, int size)
}
else if(ref->type == TYPE_TRITON)
{
+ rinfo = malloc((size_t)size * sizeof(*rinfo));
+ if (!rinfo) return -1;
+
tret = remote_triton_rpc_rosd_read(
0,
ref->u.triton.oid,
@@ -304,7 +310,9 @@ static __blocking int tc_read(struct obj_ref* ref, char* buffer, int size)
buffer,
size,
&txn_nr,
- &out_size);
+ &out_size,
+ rinfo,
+ &num_record_infos);
if(triton_is_error(tret))
{
triton_error_print(tret, "remote_triton_rpc_rosd_read()");
diff --git a/code/src/asg/asg-internal.ae b/code/src/asg/asg-internal.ae
index c7f521d..48d5f36 100644
--- a/code/src/asg/asg-internal.ae
+++ b/code/src/asg/asg-internal.ae
@@ -157,11 +157,16 @@ __blocking int asg_i_read (
triton_ret_t tret;
int64_t size;
int ret = ASG_SUCCESS;
+ struct rosd_record_info *rinfo = NULL;
+ asg_size_t i;
if (instance!=1) return ASG_ERR_OTHER;
size = MIN(bufsize, recordcount);
+ rinfo = malloc(recordcount * sizeof(*rinfo));
+ if (!rinfo) return ASG_ERR_OTHER;
+
tret = remote_triton_rpc_rosd_read(
(uint64_t)container,
(uint64_t)object,
@@ -172,13 +177,24 @@ __blocking int asg_i_read (
buf,
(uint64_t)bufsize,
(uint64_t*)version_info,
- (uint64_t*)transferred);
+ (uint64_t*)transferred,
+ rinfo,
+ (uint64_t*)record_buf_transferred);
if (triton_is_error(tret)) {
triton_error_print(tret, "remote_triton_rpc_rosd_read ");
ret = ASG_ERR_OTHER;
}
+ /* manually copy over record metadata (really, this should be a memcpy) */
+ for (i = 0; i < *record_buf_transferred; i++) {
+ record_buf[i].record_id = rinfo[i].record_id;
+ record_buf[i].seq_len = rinfo[i].num_records;
+ record_buf[i].record_len = rinfo[i].record_len;
+ record_buf[i].record_update_id = rinfo[i].record_update_id;
+ }
+ free(rinfo);
+
triton_error_destroy(tret);
return ret;
}
diff --git a/code/src/remote/mercury-engine.hae b/code/src/remote/mercury-engine.hae
index 17d5f2a..cc7db6b 100644
--- a/code/src/remote/mercury-engine.hae
+++ b/code/src/remote/mercury-engine.hae
@@ -77,7 +77,7 @@ do {\
} \
} while(0)
-#define triton_mercury_run_rpc_with_bulk(__addr, __rpc_id, __handle, __in_p, __out_p, __bulk_handle, __buffer, __size, __mode) \
+#define triton_mercury_run_rpc_with_bulk(__addr, __rpc_id, __handle, __in_p, __out_p, __bulk_handle, __nbufs, __buffers, __sizes, __mode) \
do {\
int __ret; \
struct hg_info *__hg_info; \
@@ -86,32 +86,27 @@ do {\
triton_error_msg("triton_mercury_create_handle() failure\n"); \
return(TRITON_ERR_UNKNOWN); \
} \
- if(__size > 0) { \
- __hg_info = HG_Get_info(handle); \
- __ret = HG_Bulk_create(__hg_info->hg_bulk_class, 1, (void**)&(__buffer), &(__size), __mode, &(__bulk_handle)); \
- if(__ret != HG_SUCCESS) { \
- triton_error_msg("HG_Bulk_create() failure.\n"); \
- HG_Destroy(__handle); \
- return(TRITON_ERR_UNKNOWN); \
- }\
- }\
- else {\
- __bulk_handle = HG_BULK_NULL; \
+ __hg_info = HG_Get_info(handle); \
+ __ret = HG_Bulk_create(__hg_info->hg_bulk_class, __nbufs, __buffers, __sizes, __mode, &(__bulk_handle)); \
+ if(__ret != HG_SUCCESS) { \
+ triton_error_msg("HG_Bulk_create() failure.\n"); \
+ HG_Destroy(__handle); \
+ return(TRITON_ERR_UNKNOWN); \
}\
__ret = hg_rsc_forward(__handle, (__in_p)); \
if(__ret != HG_SUCCESS) { \
triton_error_msg("hg_rsc_forward() failure.\n"); \
- if(__size > 0) HG_Bulk_free(__bulk_handle); \
+ HG_Bulk_free(__bulk_handle); \
HG_Destroy(__handle); \
return(TRITON_ERR_UNKNOWN); \
} \
__ret = HG_Get_output(__handle, (__out_p)); \
if(__ret != HG_SUCCESS) { \
triton_error_msg("HG_Get_output() failure.\n"); \
- if(__size > 0) HG_Bulk_free(__bulk_handle); \
+ HG_Bulk_free(__bulk_handle); \
HG_Destroy(__handle); \
return(TRITON_ERR_UNKNOWN); \
} \
- if(__size > 0) HG_Bulk_free(__bulk_handle); \
+ HG_Bulk_free(__bulk_handle); \
} while(0)
#endif
diff --git a/code/src/replicated-osd/rosd-create.ae b/code/src/replicated-osd/rosd-create.ae
index e86b0f5..3955e48 100644
--- a/code/src/replicated-osd/rosd-create.ae
+++ b/code/src/replicated-osd/rosd-create.ae
@@ -79,7 +79,7 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
}
if(!triton_is_error(out.tret))
{
- out.tret = triton_oid64_to_addrs(in.oid, actual_rep_factor,
+ out.tret = triton_oid_to_addrs(in.oid, actual_rep_factor,
&my_position, addr_array);
if(!triton_is_error(out.tret))
got_addrs = 1;
@@ -159,7 +159,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_create(
int position;
/* we contact the first server (master) for oid */
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-internal.hae b/code/src/replicated-osd/rosd-internal.hae
index ad024d0..227332c 100644
--- a/code/src/replicated-osd/rosd-internal.hae
+++ b/code/src/replicated-osd/rosd-internal.hae
@@ -14,18 +14,12 @@ extern uint32_t rosd_default_replication_factor;
/* default fork used to store replication factor in object */
#define REP_FACTOR_FORK UINT64_MAX
-triton_ret_t asg_oid_to_addrs(uint64_t oid,
- uint32_t replication_factor, int* my_position, na_addr_t *addr_array);
-
-triton_ret_t triton_oid64_to_addrs(
+triton_ret_t triton_oid_to_addrs(
uint64_t oid,
uint32_t replication_factor,
int* my_position,
na_addr_t *addr_array);
-triton_ret_t triton_oid_to_addrs(uint128_t oid,
- uint32_t replication_factor, int* my_position, na_addr_t *addr_array);
-
__blocking triton_ret_t interpret_errors(
triton_ret_t local_error_code,
triton_ret_t remote_error_code,
diff --git a/code/src/replicated-osd/rosd-probe-fork.ae b/code/src/replicated-osd/rosd-probe-fork.ae
index 298f360..3fc62ad 100644
--- a/code/src/replicated-osd/rosd-probe-fork.ae
+++ b/code/src/replicated-osd/rosd-probe-fork.ae
@@ -103,7 +103,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_probe_fork(
in.record = record;
in.max = max;
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-probe-object.ae b/code/src/replicated-osd/rosd-probe-object.ae
index f9cc25a..5ad0b42 100644
--- a/code/src/replicated-osd/rosd-probe-object.ae
+++ b/code/src/replicated-osd/rosd-probe-object.ae
@@ -85,7 +85,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_probe_object(
in.fork = fork;
in.max = max;
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-read.ae b/code/src/replicated-osd/rosd-read.ae
index e0dfd75..797ea40 100644
--- a/code/src/replicated-osd/rosd-read.ae
+++ b/code/src/replicated-osd/rosd-read.ae
@@ -36,8 +36,8 @@ MERCURY_GEN_PROC(triton_rpc_rosd_read_in_t,
MERCURY_GEN_PROC(triton_rpc_rosd_read_out_t,
((triton_ret_t)(tret))\
- ((int64_t)(out_size))\
- ((uint64_t)(txn_number)))
+ ((uint64_t)(data_size))\
+ ((uint64_t)(num_rec_infos)))
static hg_id_t rpc_rosd_read_id;
static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle);
@@ -46,16 +46,18 @@ static hg_return_t triton_rpc_rosd_read_handler(hg_handle_t handle);
extern struct buffer_mgmt_instance* rosd_read_buffers;
__blocking triton_ret_t remote_triton_rpc_rosd_read(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- int flags,
- void * buf,
- uint64_t buf_size,
- uint64_t * version_info,
- uint64_t * transferred)
+ uint64_t container,
+ uint64_t object,
+ uint64_t fork,
+ uint64_t start_record,
+ uint64_t recordcount,
+ int flags,
+ void * buf,
+ uint64_t buf_size,
+ uint64_t * version_info,
+ uint64_t * transferred,
+ struct rosd_record_info * record_info,
+ uint64_t * record_info_xferred)
{
triton_rpc_rosd_read_out_t out;
triton_rpc_rosd_read_in_t in;
@@ -63,17 +65,19 @@ __blocking triton_ret_t remote_triton_rpc_rosd_read(
triton_ret_t tret;
na_addr_t addr;
int position;
- size_t bulk_size;
hg_handle_t handle;
+ struct hg_info *info;
+ void * bulk_bufs[2];
+ hg_size_t bulk_sizes[2];
/* TODO: ability read from replicas as well */
/* we contact the first server (master) for oid */
- tret = asg_oid_to_addrs(object, 1, &position, &addr);
+ tret = triton_oid_to_addrs(object, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
-
+
in.container = container;
in.object = object;
in.fork = fork;
@@ -83,18 +87,22 @@ __blocking triton_ret_t remote_triton_rpc_rosd_read(
in.buf_size = buf_size;
in.flags = flags;
in.bulk_handle = HG_BULK_NULL;
- bulk_size = (size_t) buf_size;
+ bulk_bufs[0] = buf;
+ bulk_bufs[1] = record_info;
+ bulk_sizes[0] = buf_size;
+ bulk_sizes[1] = recordcount * sizeof(*record_info);
triton_mercury_run_rpc_with_bulk(addr, rpc_rosd_read_id, handle,
- &in, &out, in.bulk_handle, buf, bulk_size, HG_BULK_WRITE_ONLY);
+ &in, &out, in.bulk_handle, 2, bulk_bufs, bulk_sizes,
+ HG_BULK_WRITE_ONLY);
triton_mercury_addr_free(addr);
tret = triton_error_dup(out.tret);
if(!triton_is_error(tret))
{
- *transferred = out.out_size;
- *version_info = out.txn_number;
+ *transferred = out.data_size;
+ *record_info_xferred = out.num_rec_infos;
}
else
{
@@ -199,7 +207,7 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
/* check our position assuming a replication factor of 1 to make
* sure that we are the master for this object
*/
- out.tret = asg_oid_to_addrs(in.object, 1, &my_position, &next_addr);
+ out.tret = triton_oid_to_addrs(in.object, 1, &my_position, &next_addr);
if(triton_is_error(out.tret))
{
triton_mercury_respond(handle, &out);
@@ -215,9 +223,9 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
return(TRITON_SUCCESS);
}
- out.tret = TRITON_ERR_UNKNOWN;
- out.out_size = 0;
- out.txn_number = 0;
+ out.tret = TRITON_ERR_NOT_IMPLEMENTED;
+ out.data_size = 0;
+ out.num_rec_infos = 0;
triton_mercury_respond(handle, &out);
HG_Destroy(handle);
return(TRITON_SUCCESS);
diff --git a/code/src/replicated-osd/rosd-remove.ae b/code/src/replicated-osd/rosd-remove.ae
index 8672c92..2157864 100644
--- a/code/src/replicated-osd/rosd-remove.ae
+++ b/code/src/replicated-osd/rosd-remove.ae
@@ -171,7 +171,7 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
else if (triton_error_equal(trc, TRITON_SUCCESS))
{
memset(addr_array, 0, in.replication_factor*sizeof(*addr_array));
- out.tret = triton_oid64_to_addrs(in.oid,
+ out.tret = triton_oid_to_addrs(in.oid,
in.replication_factor,
&my_position,
addr_array);
@@ -366,7 +366,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_remove(
int position;
/* we contact the first server (master) for oid */
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-reset.ae b/code/src/replicated-osd/rosd-reset.ae
index bdfd5f2..f9d6913 100644
--- a/code/src/replicated-osd/rosd-reset.ae
+++ b/code/src/replicated-osd/rosd-reset.ae
@@ -187,7 +187,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_reset(
na_addr_t addr;
int32_t position;
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-util.ae b/code/src/replicated-osd/rosd-util.ae
index 45746f3..ec2fbd0 100644
--- a/code/src/replicated-osd/rosd-util.ae
+++ b/code/src/replicated-osd/rosd-util.ae
@@ -68,7 +68,7 @@ __blocking triton_ret_t rosd_get_addr_list(
if (!addrs)
{
triton_error_destroy(tret);
- tret = triton_oid64_to_addrs(oid, factor, &pos, addrs);
+ tret = triton_oid_to_addrs(oid, factor, &pos, addrs);
if (!triton_is_error(tret))
{
*rep_factor = factor;
diff --git a/code/src/replicated-osd/rosd-write.ae b/code/src/replicated-osd/rosd-write.ae
index 4f6d77b..89a6d40 100644
--- a/code/src/replicated-osd/rosd-write.ae
+++ b/code/src/replicated-osd/rosd-write.ae
@@ -102,7 +102,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_write(
int position;
/* we contact the first server (master) for oid */
- tret = asg_oid_to_addrs(object, 1, &position, &addr);
+ tret = triton_oid_to_addrs(object, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
@@ -413,7 +413,7 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
return(TRITON_SUCCESS);
}
- out.tret = asg_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
+ out.tret = triton_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
if(triton_is_error(out.tret))
{
triton_mercury_respond(handle, &out);
@@ -458,7 +458,7 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
return(TRITON_SUCCESS);
}
- out.tret = asg_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
+ out.tret = triton_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
if(triton_is_error(out.tret))
{
triton_mercury_respond(handle, &out);
@@ -563,7 +563,7 @@ static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
in.bulk_handle = HG_BULK_NULL;
triton_mercury_run_rpc_with_bulk(addr, rpc_rosd_write_id, handle,
- &in, &out, in.bulk_handle, data, bulk_size, HG_BULK_READ_ONLY);
+ &in, &out, in.bulk_handle, 1, &data, &bulk_size, HG_BULK_READ_ONLY);
tret = triton_error_dup(out.tret);
diff --git a/code/src/replicated-osd/rosd.ae b/code/src/replicated-osd/rosd.ae
index 051320c..3e0c31d 100644
--- a/code/src/replicated-osd/rosd.ae
+++ b/code/src/replicated-osd/rosd.ae
@@ -176,21 +176,7 @@ void triton_rpc_rosd_register(void)
return;
}
-triton_ret_t asg_oid_to_addrs(uint64_t oid, uint32_t replication_factor, int* my_position, na_addr_t *addr_array)
-{
- /* TODO: need to fix this function to truly operate in terms of 64 bit
- * oids...
- */
- uint128_t tmp_oid;
-
- tmp_oid = triton_uint128_from_uint64(oid);
-
- return(triton_oid_to_addrs(tmp_oid, replication_factor, my_position, addr_array));
-}
-
-/* a 64-bit version of triton_oid_to_addrs. Once the ROSD interfaces are
- * rewritten, we should replace it with this function */
-triton_ret_t triton_oid64_to_addrs(
+triton_ret_t triton_oid_to_addrs(
uint64_t oid,
uint32_t replication_factor,
int* my_position,
@@ -260,77 +246,6 @@ triton_ret_t triton_oid64_to_addrs(
return(TRITON_SUCCESS);
}
-/* checks system state and runs placement to identify addresses responsible
- * for a given oid.
- *
- * NOTE: caller is responsible for freeing addrs
- *
- * TODO: In the long run this functionality should reside in the traffic cop.
- */
-triton_ret_t triton_oid_to_addrs(uint128_t oid, uint32_t replication_factor, int* my_position, na_addr_t *addr_array)
-{
- triton_ret_t tret;
- char* svr_string;
- triton_node_t* target_nodes;
- int i;
- triton_node_t self;
- char *oid_str;
-
- *my_position = -1;
-
- self = triton_self_node();
-
- target_nodes = malloc(replication_factor*sizeof(*target_nodes));
- if(!target_nodes)
- {
- return(TRITON_ERR_NOMEM);
- }
-
- /* TODO: need to check status of nodes; for now just assuming all of
- * them are valid. This could just be a filter function that reduces
- * the array to only include nodes that are valid targets.
- */
-
- tret = triton_place_lookup(oid.l, target_nodes, replication_factor);
- if(triton_is_error(tret))
- {
- free(target_nodes);
- return(tret);
- }
-
- oid_str = triton_uint128_to_string(oid);
-
- for(i=0; i<replication_factor; i++)
- {
- if(triton_node_equal(self, target_nodes[i]))
- *my_position = i;
-
- svr_string = system_state_get(target_nodes[i], "addr");
- if(!svr_string)
- {
- free(target_nodes);
- return(TRITON_ERR_UNKNOWN);
- }
-
- triton_debug(triton_dbg_rosd, "triton_oid_to_addrs() mapped oid %s to server %d: %s\n", oid_str, i, svr_string);
-
- tret = triton_mercury_addr_lookup(svr_string, &addr_array[i]);
- if(triton_is_error(tret))
- {
- free(target_nodes);
- free(svr_string);
- return(tret);
- }
-
- free(svr_string);
- }
-
- if (oid_str) free(oid_str);
- free(target_nodes);
-
- return(TRITON_SUCCESS);
-}
-
/**
* Compares the error code from local operations with forwarded operations
* to determine what action the server should take (if any) and what error
diff --git a/code/src/replicated-osd/rosd.hae b/code/src/replicated-osd/rosd.hae
index 89b642a..817c1b1 100644
--- a/code/src/replicated-osd/rosd.hae
+++ b/code/src/replicated-osd/rosd.hae
@@ -25,6 +25,16 @@
*/
#define ROSD_FLAG_FIRST_WRITE 16
+/* TODO: we need to decide whether to just go with asg types or not - shadowing
+ * structs like asg_record_info_t with our own basically-equivalent types is
+ * silly and error-prone */
+struct rosd_record_info{
+ uint64_t record_id; /* first record in sequence */
+ uint64_t num_records; /* number of records in sequence */
+ uint64_t record_len; /* length of each record in sequence */
+ uint64_t record_update_id; /* version of each record in sequence */
+};
+
triton_ret_t triton_rosd_svr_init(struct sos_ctx *sos_ctx);
void triton_rosd_svr_finalize(void);
@@ -68,16 +78,18 @@ __blocking triton_ret_t remote_triton_rpc_rosd_write(
uint32_t replication_factor);
__blocking triton_ret_t remote_triton_rpc_rosd_read(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- int flags,
- void * buf,
- uint64_t buf_size,
- uint64_t * version_info,
- uint64_t * transferred);
+ uint64_t container,
+ uint64_t object,
+ uint64_t fork,
+ uint64_t start_record,
+ uint64_t recordcount,
+ int flags,
+ void * buf,
+ uint64_t buf_size,
+ uint64_t * version_info,
+ uint64_t * transferred,
+ struct rosd_record_info * record_info,
+ uint64_t * record_info_xferred);
__blocking triton_ret_t rosd_pipeline_setup_one_buffer(
struct buffer_mgmt_instance* buffer_instance,
hooks/post-receive
--
1
0
branch, trac-323-sos, updated. 7d7ea4ffa6f9f0027d1960cfee206d8fc2a337ae
by noreply@mcs.anl.gov 22 Dec '14
by noreply@mcs.anl.gov 22 Dec '14
22 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via 7d7ea4ffa6f9f0027d1960cfee206d8fc2a337ae (commit)
from 7b9c57f202cac53e2474fc359e22d5a38387b7e7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7d7ea4ffa6f9f0027d1960cfee206d8fc2a337ae
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Mon Dec 22 16:11:14 2014 -0600
boilerplate removal in asg
-----------------------------------------------------------------------
Summary of changes:
code/src/asg/asg.c | 459 +++++-----------------------------------------------
1 files changed, 42 insertions(+), 417 deletions(-)
Diff of changes:
diff --git a/code/src/asg/asg.c b/code/src/asg/asg.c
index 808fe4b..edc2688 100644
--- a/code/src/asg/asg.c
+++ b/code/src/asg/asg.c
@@ -3,82 +3,34 @@
#include <include/asg.h>
#include <src/asg/asg-internal.h>
+#define ASG_HANDLE_AE_DEFAULT(_fnname, ...) \
+ asg_completion_t c; \
+ ae_hints_t hints; \
+ ae_op_id_t op_id; \
+ int r; \
+ \
+ c.done = 0; \
+ ae_hints_init(&hints); \
+ r = ext_post_blocking(_fnname, asg_callback, &c, &hints, &op_id, &c.ret, \
+ __VA_ARGS__); \
+ if (r == AE_SUCCESS) \
+ while (!c.done) \
+ ae_poll(AE_POLL_TIMEOUT); \
+ else if (r != AE_IMMEDIATE_COMPLETION) \
+ c.ret = ASG_ERR_OTHER; \
+ /* else nothing to do if immediately completed */ \
+ ae_hints_destroy(&hints); \
+ return c.ret;
+
int asg_initialize (asg_instance_t * instance, const char * options)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_initialize,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- options);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_initialize, instance, options)
}
int asg_finalize (asg_instance_t instance)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_finalize,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_finalize, instance)
}
int asg_read (
@@ -98,54 +50,10 @@ int asg_read (
asg_size_t * record_buf_transferred,
asg_update_id_t * version_info)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_read,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- flags,
- version_condition,
- buf,
- bufsize,
- transferred,
- record_buf,
- record_buf_transferred,
- version_info);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_read, instance, location, container, object,
+ fork, start_record, recordcount, flags, version_condition, buf,
+ bufsize, transferred, record_buf, record_buf_transferred,
+ version_info)
}
int asg_write (
@@ -163,52 +71,9 @@ int asg_write (
const void * data,
asg_size_t * transferred)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_write,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- recordlen,
- flags,
- version_condition,
- new_version,
- data,
- transferred);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_write, instance, location, container, object,
+ fork, start_record, recordcount, recordlen, flags,
+ version_condition, new_version, data, transferred)
}
int asg_punch (
@@ -224,50 +89,9 @@ int asg_punch (
asg_update_id_t * new_version,
asg_size_t * transferred)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_punch,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- flags,
- version_condition,
- new_version,
- transferred);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_punch, instance, location, container, object,
+ fork, start_record, recordcount, flags, version_condition,
+ new_version, transferred)
}
int asg_reset (
@@ -283,50 +107,9 @@ int asg_reset (
asg_update_id_t update_id_condition,
asg_size_t * reset_count)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_reset,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- recordlen,
- flags,
- update_id_condition,
- reset_count);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_reset, instance, location, container, object,
+ fork, start_record, recordcount, recordlen, flags,
+ update_id_condition, reset_count)
}
int asg_probe_system (
@@ -338,46 +121,8 @@ int asg_probe_system (
asg_size_t * transferred, /* number of container structures returned */
asg_container_id_t * next)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_system,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT( asg_i_probe_system, instance, location, start,
+ buf, maxitems, transferred, next)
}
int asg_probe_container (
@@ -390,47 +135,8 @@ int asg_probe_container (
asg_size_t * transferred,
asg_object_id_t * next)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_container,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_probe_container, instance, location,
+ container, start, buf, maxitems, transferred, next)
}
int asg_probe_object (
@@ -444,48 +150,8 @@ int asg_probe_object (
asg_size_t * transferred,
asg_fork_id_t * next)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_object,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_probe_object, instance, location, container,
+ object, start, buf, maxitems, transferred, next)
}
int asg_probe_fork (
@@ -500,47 +166,6 @@ int asg_probe_fork (
asg_size_t * transferred,
asg_record_id_t * next)
{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_fork,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
+ ASG_HANDLE_AE_DEFAULT(asg_i_probe_fork, instance, location, container,
+ object, fork, start, buf, maxitems, transferred, next)
}
hooks/post-receive
--
1
0
branch, trac-323-sos, updated. 7b9c57f202cac53e2474fc359e22d5a38387b7e7
by noreply@mcs.anl.gov 22 Dec '14
by noreply@mcs.anl.gov 22 Dec '14
22 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via 7b9c57f202cac53e2474fc359e22d5a38387b7e7 (commit)
via cf79656cb1ab4931ab10d0d51e9b53b73bcb7b80 (commit)
from f426c0145b6b4f0ecf0e1880f0b9ce2caf560269 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7b9c57f202cac53e2474fc359e22d5a38387b7e7
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Mon Dec 22 15:18:50 2014 -0600
fix invalid ptr free
commit cf79656cb1ab4931ab10d0d51e9b53b73bcb7b80
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Mon Dec 22 15:15:10 2014 -0600
got rid of the parallel "rsos" impl now that tosd is gone
replaced the original rosd-read/write with the sos equivalent
-----------------------------------------------------------------------
Summary of changes:
code/include/asg.h | 101 -----
code/src/admin-tools/triton-cp.ae | 14 +-
code/src/admin-tools/triton-mkdat.ae | 7 +-
code/src/asg/asg-internal.ae | 259 ++----------
code/src/asg/asg-internal.hae | 101 -----
code/src/asg/asg.c | 465 -------------------
code/src/replicated-osd/Makefile.subdir | 4 +-
code/src/replicated-osd/rosd-read.ae | 79 ++--
code/src/replicated-osd/rosd-remove.ae | 4 -
code/src/replicated-osd/rosd-write.ae | 749 +++++++++++++++++--------------
code/src/replicated-osd/rosd.ae | 2 -
code/src/replicated-osd/rosd.hae | 42 +--
code/src/replicated-osd/rsos-read.ae | 371 ---------------
code/src/replicated-osd/rsos-write.ae | 729 ------------------------------
code/tests/Makefile.subdir | 7 +-
code/tests/asg/test-asg-simple-sos.c | 201 ---------
code/tests/asg/test-asg-simple-sos.sh | 26 --
17 files changed, 520 insertions(+), 2641 deletions(-)
delete mode 100644 code/src/replicated-osd/rsos-read.ae
delete mode 100644 code/src/replicated-osd/rsos-write.ae
delete mode 100644 code/tests/asg/test-asg-simple-sos.c
delete mode 100755 code/tests/asg/test-asg-simple-sos.sh
Diff of changes:
diff --git a/code/include/asg.h b/code/include/asg.h
index d4e0a23..2557f33 100644
--- a/code/include/asg.h
+++ b/code/include/asg.h
@@ -126,23 +126,6 @@ int asg_finalize (asg_instance_t instance);
* are present in the range -- ASG_UPDATE_ID_MIXED
*
* */
-int asg_read_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- void * buf,
- size_t bufsize,
- asg_size_t * transferred,
- asg_record_info_t * record_buf,
- asg_size_t * record_buf_transferred,
- asg_update_id_t * update_id_info);
-
int asg_read (
asg_instance_t instance,
asg_location_t location,
@@ -160,22 +143,6 @@ int asg_read (
asg_size_t * record_buf_transferred,
asg_update_id_t * update_id_info);
-int asg_write_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- asg_update_id_t * new_update_id,
- const void * data,
- asg_size_t * transferred);
-
-
int asg_write (
asg_instance_t instance,
asg_location_t location,
@@ -196,19 +163,6 @@ int asg_write (
*
* Transferred indicates the number of records updated.
*/
-int asg_punch_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- asg_update_id_t * new_update_id,
- asg_size_t * transferred);
-
int asg_punch (
asg_instance_t instance,
asg_location_t location,
@@ -231,19 +185,6 @@ int asg_punch (
* Passing ASG_OBJECT_NULL resets all objects in the container.
* Passing ASG_CONTAINER_NULL resets all containers in the storage system.
*/
-int asg_reset_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- asg_size_t * reset_count);
-
int asg_reset (
asg_instance_t instance,
asg_location_t location,
@@ -293,15 +234,6 @@ typedef struct
asg_size_t object_count; /* objects per container in the seq. */
} asg_container_info_t;
-int asg_probe_system_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t start,
- asg_container_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred, /* number of container structures returned */
- asg_container_id_t * next);
-
int asg_probe_system (
asg_instance_t instance,
asg_location_t location,
@@ -319,16 +251,6 @@ typedef struct
asg_size_t fork_count;
} asg_object_info_t;
-int asg_probe_container_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t start,
- asg_object_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_object_id_t * next);
-
int asg_probe_container (
asg_instance_t instance,
asg_location_t location,
@@ -347,17 +269,6 @@ typedef struct
asg_size_t record_count;
} asg_fork_info_t;
-int asg_probe_object_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t start,
- asg_fork_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_fork_id_t * next);
-
int asg_probe_object (
asg_instance_t instance,
asg_location_t location,
@@ -369,18 +280,6 @@ int asg_probe_object (
asg_size_t * transferred,
asg_fork_id_t * next);
-int asg_probe_fork_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start,
- asg_record_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_record_id_t * next);
-
int asg_probe_fork (
asg_instance_t instance,
asg_location_t location,
diff --git a/code/src/admin-tools/triton-cp.ae b/code/src/admin-tools/triton-cp.ae
index e6a3106..9e5cd29 100644
--- a/code/src/admin-tools/triton-cp.ae
+++ b/code/src/admin-tools/triton-cp.ae
@@ -298,12 +298,13 @@ static __blocking int tc_read(struct obj_ref* ref, char* buffer, int size)
0,
ref->u.triton.oid,
0,
+ ref->u.triton.offset,
+ size,
+ 0,
buffer,
size,
- ref->u.triton.offset,
&txn_nr,
- &out_size,
- 0);
+ &out_size);
if(triton_is_error(tret))
{
triton_error_print(tret, "remote_triton_rpc_rosd_read()");
@@ -346,10 +347,13 @@ static __blocking int tc_write(struct obj_ref* ref, const char* buffer, int size
0,
ref->u.triton.oid,
0,
- buffer,
- size,
ref->u.triton.offset,
+ size,
+ 1,
+ buffer,
+ 0,
0,
+ NULL,
0);
if(triton_is_error(tret))
{
diff --git a/code/src/admin-tools/triton-mkdat.ae b/code/src/admin-tools/triton-mkdat.ae
index 55f7d1e..8bca60d 100644
--- a/code/src/admin-tools/triton-mkdat.ae
+++ b/code/src/admin-tools/triton-mkdat.ae
@@ -229,10 +229,13 @@ __blocking int aesop_main(int argc, char **argv){
0,
oid,
fork,
- (char*) buffer, /* why a char*? */
- opts.size_per_write,
write_nr * opts.size_per_write,
+ opts.size_per_write,
+ 1,
+ (char*) buffer, /* why a char*? */
+ 0,
0,
+ NULL,
0);
if(triton_is_error(tret)) {
triton_error_print(tret, "remote_triton_rpc_rosd_write()");
diff --git a/code/src/asg/asg-internal.ae b/code/src/asg/asg-internal.ae
index a40ccca..c7f521d 100644
--- a/code/src/asg/asg-internal.ae
+++ b/code/src/asg/asg-internal.ae
@@ -71,84 +71,6 @@ __blocking int asg_i_initialize(asg_instance_t *instance,
return(ASG_SUCCESS);
}
-/**
- * dismiss location arg.
- * container:object => oid;
- * fork => oid_fork;
- * record => bytes stream
- */
-__blocking int asg_i_write (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- asg_update_id_t * new_version,
- const void * data,
- asg_size_t * transferred)
-{
- triton_ret_t tret;
-
- const char * replication_factor_env;
- uint32_t replication_factor;
- //build oid and get server info from it;
-
- /**
- * last two args are: uint64_t txn_number, uint32_t flags;
- * remote_triton_rpc_rosd_write does not provide the ability to check
- * whether current condition satisfy the 'version_condition', we need to
- * implement it before calling write function.
-
- printf("oid is %s\n", triton_uint128_to_string(oid));
- printf("fork_id: %ld\n", (uint64_t)fork_id);
- printf("data: %s, has %d lengh with new version: %ld with flag:%d\n", data, recordlen, (uint64_t)new_version, flags);
- */
-
- /* hack: use environment variable to control the replication factor */
- replication_factor = 0;
- replication_factor_env = getenv("TRITON_ASG_RF");
- if (replication_factor_env){
- if (0 == sscanf(replication_factor_env, "%d", &replication_factor)){
- /* simply ignore rather than returning something of interest */
- replication_factor = 0;
- }
- }
-
- tret = remote_triton_rpc_rosd_create(container, object,
- replication_factor, 0);
- if(triton_is_error(tret) && !triton_error_equal(TRITON_ERR_EXIST, tret))
- {
- triton_error_print(tret, "remote_triton_rpc_rosd_create");
- triton_error_destroy(tret);
- return(ASG_ERR_OTHER);
- }
-
- tret = remote_triton_rpc_rosd_write(container,
- object,
- fork,
- data,
- recordcount,
- start_record,
- new_version,
- 0);
-
- if (triton_is_error(tret))
- {
- triton_error_print(tret, "remote_triton_rpc_rosd_write ");
- triton_error_destroy(tret);
- return(ASG_ERR_OTHER);
- }
- triton_error_destroy(tret);
-
- *transferred = recordcount * recordlen;
-
- return(ASG_SUCCESS);
-}
/**
* dismiss location arg.
@@ -156,7 +78,7 @@ __blocking int asg_i_write (
* fork => oid_fork;
* record => bytes stream
*/
-__blocking int asg_i_write_sos (
+__blocking int asg_i_write (
asg_instance_t instance,
asg_location_t location,
asg_container_id_t container,
@@ -198,13 +120,13 @@ __blocking int asg_i_write_sos (
}
}
- tret = remote_triton_rpc_rsos_write(container, object, fork,
+ tret = remote_triton_rpc_rosd_write(container, object, fork,
start_record, recordcount, recordlen, data, flags, version_condition,
new_version, replication_factor);
if (triton_is_error(tret))
{
- triton_error_print(tret, "remote_triton_rpc_rsos_write ");
+ triton_error_print(tret, "remote_triton_rpc_rosd_write ");
triton_error_destroy(tret);
return(ASG_ERR_OTHER);
}
@@ -215,7 +137,7 @@ __blocking int asg_i_write_sos (
return(ASG_SUCCESS);
}
-__blocking int asg_i_read_sos (
+__blocking int asg_i_read (
asg_instance_t instance,
asg_location_t location,
asg_container_id_t container,
@@ -240,7 +162,7 @@ __blocking int asg_i_read_sos (
size = MIN(bufsize, recordcount);
- tret = remote_triton_rpc_rsos_read(
+ tret = remote_triton_rpc_rosd_read(
(uint64_t)container,
(uint64_t)object,
(uint64_t)fork,
@@ -253,78 +175,14 @@ __blocking int asg_i_read_sos (
(uint64_t*)transferred);
if (triton_is_error(tret)) {
- triton_error_print(tret, "remote_triton_rpc_rsos_read ");
+ triton_error_print(tret, "remote_triton_rpc_rosd_read ");
ret = ASG_ERR_OTHER;
- goto fini;
}
-fini:
triton_error_destroy(tret);
return ret;
}
-__blocking int asg_i_read (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- void * buf,
- size_t bufsize,
- asg_size_t * transferred,
- asg_record_info_t * record_buf,
- asg_size_t * record_buf_transferred,
- asg_update_id_t * version_info)
-{
- triton_ret_t tret;
- int64_t size;
-
- size = MIN(bufsize, recordcount);
-
- tret = remote_triton_rpc_rosd_read(
- container,
- object,
- fork,
- buf,
- size,
- start_record,
- version_info,
- (int64_t*)transferred,
- flags);
-
-
- if (triton_is_error(tret))
- {
- triton_error_print(tret, "remote_triton_rpc_rosd_read ");
- triton_error_destroy(tret);
- return(ASG_ERR_OTHER);
- }
-
- triton_error_destroy(tret);
- return(ASG_SUCCESS);
-}
-
-__blocking int asg_i_punch_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- asg_update_id_t * new_version,
- asg_size_t * transferred)
-{
- triton_error_msg("asg_punch_sos not yet supported\n");
- return(ASG_ERR_OTHER);
-}
-
__blocking int asg_i_punch (
asg_instance_t instance,
asg_location_t location,
@@ -339,16 +197,32 @@ __blocking int asg_i_punch (
asg_size_t * transferred)
{
triton_ret_t tret;
+ const char * replication_factor_env;
+ uint32_t replication_factor;
+
+ /* hack: use environment variable to control the replication factor */
+ replication_factor = 0;
+ replication_factor_env = getenv("TRITON_ASG_RF");
+ if (replication_factor_env){
+ if (0 == sscanf(replication_factor_env, "%d", &replication_factor)){
+ /* simply ignore rather than returning something of interest */
+ replication_factor = 0;
+ }
+ }
char *data="punch";
- tret = remote_triton_rpc_rosd_write(container,
- object,
- fork,
- data,
- recordcount,
- start_record,
- version_condition,
- flags);
+ tret = remote_triton_rpc_rosd_write(
+ container,
+ object,
+ fork,
+ start_record,
+ recordcount,
+ 0, /* TODO: what's the recordlen?? */
+ data,
+ flags,
+ version_condition,
+ new_version,
+ replication_factor);
if (triton_is_error(tret))
{
triton_error_print(tret, "remote_triton_rpc_rosd_write ");
@@ -359,23 +233,6 @@ __blocking int asg_i_punch (
return(ASG_SUCCESS);
}
-__blocking int asg_i_reset_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- asg_size_t * reset_count)
-{
- triton_error_msg("asg_reset_sos not yet supported\n");
- return ASG_ERR_OTHER;
-}
-
__blocking int asg_i_reset (
asg_instance_t instance,
asg_location_t location,
@@ -438,18 +295,6 @@ __blocking int asg_i_finalize(asg_instance_t instance)
return(ASG_SUCCESS);
}
-__blocking int asg_i_probe_system_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t start,
- asg_container_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_container_id_t * next)
-{
- return(ASG_SUCCESS);
-}
-
__blocking int asg_i_probe_system (
asg_instance_t instance,
asg_location_t location,
@@ -462,19 +307,6 @@ __blocking int asg_i_probe_system (
return(ASG_SUCCESS);
}
-__blocking int asg_i_probe_container_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t start,
- asg_object_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_object_id_t * next)
-{
- return(ASG_SUCCESS);
-}
-
__blocking int asg_i_probe_container (
asg_instance_t instance,
asg_location_t location,
@@ -488,21 +320,6 @@ __blocking int asg_i_probe_container (
return(ASG_SUCCESS);
}
-__blocking int asg_i_probe_object_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t start,
- asg_fork_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_fork_id_t * next)
-{
- triton_error_msg("asg_probe_object_sos not yet supported\n");
- return ASG_ERR_OTHER;
-}
-
__blocking int asg_i_probe_object (
asg_instance_t instance,
asg_location_t location,
@@ -572,22 +389,6 @@ __blocking int asg_i_probe_object (
return(rc);
}
-__blocking int asg_i_probe_fork_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start,
- asg_record_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_record_id_t * next)
-{
- triton_error_msg("asg_probe_fork_sos not yet supported\n");
- return ASG_ERR_OTHER;
-}
-
__blocking int asg_i_probe_fork (
asg_instance_t instance,
asg_location_t location,
diff --git a/code/src/asg/asg-internal.hae b/code/src/asg/asg-internal.hae
index 75c2a9e..31f8877 100644
--- a/code/src/asg/asg-internal.hae
+++ b/code/src/asg/asg-internal.hae
@@ -30,22 +30,6 @@ void asg_callback (void *user_ptr, int ret);
__blocking int asg_i_initialize(asg_instance_t *instance, const char *options);
__blocking int asg_i_finalize(asg_instance_t instance);
-__blocking int asg_i_write_sos(
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- asg_update_id_t * new_version,
- const void * data,
- asg_size_t * transferred);
-
-
__blocking int asg_i_write (
asg_instance_t instance,
asg_location_t location,
@@ -61,23 +45,6 @@ __blocking int asg_i_write (
const void * data,
asg_size_t * transferred);
-__blocking int asg_i_read_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- void * buf,
- size_t bufsize,
- asg_size_t * transferred,
- asg_record_info_t * record_buf,
- asg_size_t * record_buf_transferred,
- asg_update_id_t * version_info);
-
__blocking int asg_i_read (
asg_instance_t instance,
asg_location_t location,
@@ -100,19 +67,6 @@ __blocking int asg_i_read (
*
* Transferred indicates the number of records updated.
*/
-__blocking int asg_i_punch_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- asg_update_id_t * new_version,
- asg_size_t * transferred);
-
__blocking int asg_i_punch (
asg_instance_t instance,
asg_location_t location,
@@ -126,19 +80,6 @@ __blocking int asg_i_punch (
asg_update_id_t * new_version,
asg_size_t * transferred);
-__blocking int asg_i_reset_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- asg_size_t * reset_count);
-
__blocking int asg_i_reset (
asg_instance_t instance,
asg_location_t location,
@@ -152,15 +93,6 @@ __blocking int asg_i_reset (
asg_update_id_t update_id_condition,
asg_size_t * reset_count);
-__blocking int asg_i_probe_system_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t start,
- asg_container_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_container_id_t * next);
-
__blocking int asg_i_probe_system (
asg_instance_t instance,
asg_location_t location,
@@ -170,16 +102,6 @@ __blocking int asg_i_probe_system (
asg_size_t * transferred,
asg_container_id_t * next);
-__blocking int asg_i_probe_container_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t start,
- asg_object_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_object_id_t * next);
-
__blocking int asg_i_probe_container (
asg_instance_t instance,
asg_location_t location,
@@ -190,17 +112,6 @@ __blocking int asg_i_probe_container (
asg_size_t * transferred,
asg_object_id_t * next);
-__blocking int asg_i_probe_object_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t start,
- asg_fork_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_fork_id_t * next);
-
__blocking int asg_i_probe_object (
asg_instance_t instance,
asg_location_t location,
@@ -212,18 +123,6 @@ __blocking int asg_i_probe_object (
asg_size_t * transferred,
asg_fork_id_t * next);
-__blocking int asg_i_probe_fork_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start,
- asg_record_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_record_id_t * next);
-
__blocking int asg_i_probe_fork (
asg_instance_t instance,
asg_location_t location,
diff --git a/code/src/asg/asg.c b/code/src/asg/asg.c
index e2876fe..808fe4b 100644
--- a/code/src/asg/asg.c
+++ b/code/src/asg/asg.c
@@ -81,74 +81,6 @@ int asg_finalize (asg_instance_t instance)
return c.ret;
}
-int asg_read_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- void * buf,
- size_t bufsize,
- asg_size_t * transferred,
- asg_record_info_t * record_buf,
- asg_size_t * record_buf_transferred,
- asg_update_id_t * version_info)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_read_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- flags,
- version_condition,
- buf,
- bufsize,
- transferred,
- record_buf,
- record_buf_transferred,
- version_info);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
-
int asg_read (
asg_instance_t instance,
asg_location_t location,
@@ -216,69 +148,6 @@ int asg_read (
return c.ret;
}
-int asg_write_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- asg_update_id_t * new_version,
- const void * data,
- asg_size_t * transferred)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_write_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- recordlen,
- flags,
- version_condition,
- new_version,
- data,
- transferred);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_write (
asg_instance_t instance,
asg_location_t location,
@@ -342,65 +211,6 @@ int asg_write (
return c.ret;
}
-int asg_punch_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_flags_t flags,
- asg_update_id_t version_condition,
- asg_update_id_t * new_version,
- asg_size_t * transferred)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_punch_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- flags,
- version_condition,
- new_version,
- transferred);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_punch (
asg_instance_t instance,
asg_location_t location,
@@ -460,65 +270,6 @@ int asg_punch (
return c.ret;
}
-int asg_reset_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start_record,
- asg_size_t recordcount,
- asg_size_t recordlen,
- asg_flags_t flags,
- asg_update_id_t update_id_condition,
- asg_size_t * reset_count)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_reset_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start_record,
- recordcount,
- recordlen,
- flags,
- update_id_condition,
- reset_count);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_reset (
asg_instance_t instance,
asg_location_t location,
@@ -578,57 +329,6 @@ int asg_reset (
return c.ret;
}
-int asg_probe_system_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t start,
- asg_container_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred, /* number of container structures returned */
- asg_container_id_t * next)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_system_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_probe_system (
asg_instance_t instance,
asg_location_t location,
@@ -680,59 +380,6 @@ int asg_probe_system (
return c.ret;
}
-int asg_probe_container_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t start,
- asg_object_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_object_id_t * next)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_container_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_probe_container (
asg_instance_t instance,
asg_location_t location,
@@ -786,61 +433,6 @@ int asg_probe_container (
return c.ret;
}
-int asg_probe_object_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t start,
- asg_fork_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_fork_id_t * next)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_object_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_probe_object (
asg_instance_t instance,
asg_location_t location,
@@ -896,63 +488,6 @@ int asg_probe_object (
return c.ret;
}
-int asg_probe_fork_sos (
- asg_instance_t instance,
- asg_location_t location,
- asg_container_id_t container,
- asg_object_id_t object,
- asg_fork_id_t fork,
- asg_record_id_t start,
- asg_record_info_t * buf,
- asg_size_t maxitems,
- asg_size_t * transferred,
- asg_record_id_t * next)
-{
- asg_completion_t c;
- ae_hints_t hints;
- ae_op_id_t op_id;
- int r;
-
- c.done = 0;
- ae_hints_init(&hints);
-
- r = ext_post_blocking(asg_i_probe_fork_sos,
- asg_callback,
- &c,
- &hints,
- &op_id,
- &c.ret,
- instance,
- location,
- container,
- object,
- fork,
- start,
- buf,
- maxitems,
- transferred,
- next);
- if (r == AE_SUCCESS)
- {
- while(!c.done)
- {
- ae_poll(AE_POLL_TIMEOUT);
- }
- }
- else if (r == AE_IMMEDIATE_COMPLETION)
- {
- // nothing to do here
- }
- else
- {
- c.ret = ASG_ERR_OTHER;
- }
-
- ae_hints_destroy(&hints);
-
- return c.ret;
-}
-
int asg_probe_fork (
asg_instance_t instance,
asg_location_t location,
diff --git a/code/src/replicated-osd/Makefile.subdir b/code/src/replicated-osd/Makefile.subdir
index 703cd31..d18c08d 100644
--- a/code/src/replicated-osd/Makefile.subdir
+++ b/code/src/replicated-osd/Makefile.subdir
@@ -15,9 +15,7 @@ src_libtriton_a_SOURCES += \
src/replicated-osd/rosd-probe-object.ae \
src/replicated-osd/rosd-reset.ae \
src/replicated-osd/rosd-read.ae \
- src/replicated-osd/rosd-write.ae \
- src/replicated-osd/rsos-write.ae \
- src/replicated-osd/rsos-read.ae
+ src/replicated-osd/rosd-write.ae
AE_SRC += \
src/replicated-osd/rosd-util.ae \
diff --git a/code/src/replicated-osd/rosd-read.ae b/code/src/replicated-osd/rosd-read.ae
index e869ee5..e0dfd75 100644
--- a/code/src/replicated-osd/rosd-read.ae
+++ b/code/src/replicated-osd/rosd-read.ae
@@ -26,12 +26,14 @@ extern int64_t rosd_read_xfer_pipeline_depth;
/* Mercury RPC structures for rosd_read */
MERCURY_GEN_PROC(triton_rpc_rosd_read_in_t,
((uint64_t)(container))\
- ((uint64_t)(oid))\
- ((uint64_t)(oid_fork))\
- ((int64_t)(size))\
- ((int64_t)(offset))\
+ ((uint64_t)(object))\
+ ((uint64_t)(fork))\
+ ((uint64_t)(start_record))\
+ ((uint64_t)(recordcount))\
((uint32_t)(flags))\
- ((hg_bulk_t)(bulk_handle)))
+ ((hg_bulk_t)(bulk_handle))\
+ ((uint64_t)(buf_size)))
+
MERCURY_GEN_PROC(triton_rpc_rosd_read_out_t,
((triton_ret_t)(tret))\
((int64_t)(out_size))\
@@ -44,15 +46,16 @@ static hg_return_t triton_rpc_rosd_read_handler(hg_handle_t handle);
extern struct buffer_mgmt_instance* rosd_read_buffers;
__blocking triton_ret_t remote_triton_rpc_rosd_read(
- uint64_t container,
- uint64_t oid,
- uint64_t fork,
- char* buffer,
- int64_t size,
- int64_t offset,
- uint64_t* out_txn_number,
- int64_t* out_size,
- uint32_t flags)
+ uint64_t container,
+ uint64_t object,
+ uint64_t fork,
+ uint64_t start_record,
+ uint64_t recordcount,
+ int flags,
+ void * buf,
+ uint64_t buf_size,
+ uint64_t * version_info,
+ uint64_t * transferred)
{
triton_rpc_rosd_read_out_t out;
triton_rpc_rosd_read_in_t in;
@@ -65,36 +68,38 @@ __blocking triton_ret_t remote_triton_rpc_rosd_read(
/* TODO: ability read from replicas as well */
/* we contact the first server (master) for oid */
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = asg_oid_to_addrs(object, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
-
+
in.container = container;
- in.oid = oid;
- in.oid_fork = fork;
- in.size = size;
- in.offset = offset;
+ in.object = object;
+ in.fork = fork;
+ in.start_record = start_record;
+ in.recordcount = recordcount;
+ in.flags = flags;
+ in.buf_size = buf_size;
in.flags = flags;
in.bulk_handle = HG_BULK_NULL;
- bulk_size = (size_t) size;
+ bulk_size = (size_t) buf_size;
triton_mercury_run_rpc_with_bulk(addr, rpc_rosd_read_id, handle,
- &in, &out, in.bulk_handle, buffer, bulk_size, HG_BULK_WRITE_ONLY);
+ &in, &out, in.bulk_handle, buf, bulk_size, HG_BULK_WRITE_ONLY);
triton_mercury_addr_free(addr);
tret = triton_error_dup(out.tret);
if(!triton_is_error(tret))
{
- *out_size = out.out_size;
- *out_txn_number = out.txn_number;
+ *transferred = out.out_size;
+ *version_info = out.txn_number;
}
else
{
- *out_size = 0;
- *out_txn_number = 0;
+ *transferred = 0;
+ *version_info = 0;
}
HG_Free_output(handle, &out);
@@ -105,11 +110,12 @@ __blocking triton_ret_t remote_triton_rpc_rosd_read(
}
+#if 0
+/* TODO: convert me to rosd */
static __blocking triton_ret_t rosd_read_xfer_one_buffer(
struct hg_info *hg_info,
char* tmp_buffer,
- uint64_t container,
- uint64_t oid,
+ uint128_t oid,
uint64_t fork,
int64_t size,
int64_t offset,
@@ -122,8 +128,6 @@ static __blocking triton_ret_t rosd_read_xfer_one_buffer(
hg_bulk_t bulk_handle = HG_BULK_NULL;
int ret;
- tret = TRITON_ERR_NOT_IMPLEMENTED;
- /* TODO: REPLACEME
tret = tosd_read_versioned(
oid,
fork,
@@ -136,7 +140,6 @@ static __blocking triton_ret_t rosd_read_xfer_one_buffer(
out_size,
0,
txn_number);
- */
if(triton_is_error(tret))
{
@@ -170,6 +173,7 @@ static __blocking triton_ret_t rosd_read_xfer_one_buffer(
return(tret);
}
+#endif
static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
{
@@ -185,7 +189,7 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
triton_mutex_t output_mutex;
struct hg_info *hg_info = NULL;
- //triton_debug(triton_dbg_rosd, "Called triton_rpc_rosd_read()\n");
+ triton_debug(triton_dbg_rosd, "Called triton_rpc_rosd_read()\n");
hg_info = HG_Get_info(handle);
@@ -195,7 +199,7 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
/* check our position assuming a replication factor of 1 to make
* sure that we are the master for this object
*/
- out.tret = triton_oid64_to_addrs(in.oid, 1, &my_position, &next_addr);
+ out.tret = asg_oid_to_addrs(in.object, 1, &my_position, &next_addr);
if(triton_is_error(out.tret))
{
triton_mercury_respond(handle, &out);
@@ -211,10 +215,15 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
return(TRITON_SUCCESS);
}
- out.tret = TRITON_SUCCESS;
+ out.tret = TRITON_ERR_UNKNOWN;
out.out_size = 0;
out.txn_number = 0;
+ triton_mercury_respond(handle, &out);
+ HG_Destroy(handle);
+ return(TRITON_SUCCESS);
+#if 0
+ /* TODO: convert to rosd */
size_remaining = in.size;
local_offset = in.offset;
remote_offset = 0;
@@ -277,7 +286,6 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
tret = rosd_read_xfer_one_buffer(
hg_info,
buffer,
- in.container,
in.oid,
in.oid_fork,
this_size,
@@ -336,6 +344,7 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
HG_Destroy(handle);
return(TRITON_SUCCESS);
+#endif
}
TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_read)
diff --git a/code/src/replicated-osd/rosd-remove.ae b/code/src/replicated-osd/rosd-remove.ae
index 2a16d73..8672c92 100644
--- a/code/src/replicated-osd/rosd-remove.ae
+++ b/code/src/replicated-osd/rosd-remove.ae
@@ -86,8 +86,6 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
int i;
na_addr_t *addr_array;
na_addr_t next_addr;
- char *oid_str;
-
triton_ret_t tret;
uint32_t replication_factor;
char* mem_offsets[1];
@@ -113,7 +111,6 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
in.replication_factor,
llu(in.niid),
in.expected_position);
- if (oid_str) free(oid_str);
/*
* A replication factor of zero indicates this is the initial client
@@ -330,7 +327,6 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_remove(
int ret;
triton_ret_t tret;
int position;
- char *oid_str;
hg_handle_t handle;
in.container = container;
diff --git a/code/src/replicated-osd/rosd-write.ae b/code/src/replicated-osd/rosd-write.ae
index 74fab1e..4f6d77b 100644
--- a/code/src/replicated-osd/rosd-write.ae
+++ b/code/src/replicated-osd/rosd-write.ae
@@ -5,6 +5,7 @@
#include <mercury_macros.h>
#include <mercury_proc.h>
#include <assert.h>
+#include <sos.hae>
#include "src/replicated-osd/rosd.hae"
#include "src/replicated-osd/rosd-internal.hae"
@@ -21,22 +22,27 @@
* keep in flight for a single write operation
*/
extern int64_t rosd_write_xfer_pipeline_depth;
+extern struct sos_ctx* g_sos_ctx;
+extern int64_t rosd_write_buffer_size;
+
+/* Mercury RPC structures for rsos_write */
+MERCURY_GEN_PROC(triton_rpc_rosd_write_out_t,
+ ((triton_ret_t)(tret))\
+ ((uint64_t)(new_update_id)))
-/* Mercury RPC structures for rosd_write */
-MERCURY_GEN_PROC(triton_rpc_rosd_write_out_t, ((triton_ret_t)(tret)))
MERCURY_GEN_PROC(triton_rpc_rosd_write_in_t,
((uint64_t)(container))\
- ((uint64_t)(oid))\
- ((uint64_t)(oid_fork))\
- ((int64_t)(offset))\
- ((int64_t)(size))\
+ ((uint64_t)(object))\
+ ((uint64_t)(fork))\
+ ((uint64_t)(start_record))\
+ ((uint64_t)(recordcount))\
+ ((uint64_t)(recordlen))\
((uint32_t)(flags))\
- ((uint32_t)(replication_factor)) /* cannot be set by clients */\
- ((uint32_t)(expected_position)) /* cannot be set by clients */\
- ((uint64_t)(txn_number)) /* cannot be set by clients unless a corresponding conditional flag is set */\
+ ((uint64_t)(update_id_condition))\
+ ((uint32_t)(expected_position))\
+ ((uint32_t)(replication_factor))\
((hg_bulk_t)(bulk_handle)))
-
extern struct buffer_mgmt_instance* rosd_write_buffers;
static hg_id_t rpc_rosd_write_id;
static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle);
@@ -44,266 +50,311 @@ static hg_return_t triton_rpc_rosd_write_handler(hg_handle_t handle);
static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
na_addr_t addr,
uint64_t container,
- uint64_t oid,
+ uint64_t object,
uint64_t fork,
- char* buffer,
- int64_t size,
- int64_t offset,
+ uint64_t start_record,
+ uint64_t recordcount,
+ uint64_t recordlen,
+ void* data,
uint32_t flags,
- uint32_t replication_factor,
+ uint64_t update_id_condition,
+ uint64_t *new_update_id,
uint32_t expected_position,
- uint64_t txn_number);
+ uint32_t replication_factor);
static int is_usage_error_write(triton_ret_t tret);
+static __blocking triton_ret_t resolve_replication_factor(
+ triton_rpc_rosd_write_in_t *in);
static __blocking triton_ret_t rosd_write_do_work(
na_addr_t next_addr,
- uint64_t container,
- uint64_t oid,
- uint64_t oid_fork,
char* buffer,
- int64_t size,
- int64_t offset,
- uint32_t flags,
- uint32_t replication_factor,
- uint64_t txn_number,
int my_position,
- int from_client_flag);
+ uint64_t start_record,
+ uint64_t recordcount,
+ triton_rpc_rosd_write_in_t* in);
+
static __blocking triton_ret_t rosd_write_local_storage(
uint64_t container,
- uint64_t oid,
- uint64_t oid_fork,
- uint64_t txn_number,
- char *buffer,
- int64_t size,
- int64_t offset,
- uint32_t flags);
-
+ uint64_t object,
+ uint64_t fork,
+ uint64_t start_record,
+ uint64_t recordcount,
+ uint64_t recordlen,
+ char* buffer,
+ uint32_t flags,
+ uint64_t update_id_condition,
+ uint64_t *new_update_id);
__blocking triton_ret_t remote_triton_rpc_rosd_write(
uint64_t container,
- uint64_t oid,
+ uint64_t object,
uint64_t fork,
- char* buffer,
- int64_t size,
- int64_t offset,
- uint64_t txn_number,
- uint32_t flags)
+ uint64_t start_record,
+ uint64_t recordcount,
+ uint64_t recordlen,
+ void* data,
+ uint32_t flags,
+ uint64_t update_id_condition,
+ uint64_t *new_update_id,
+ uint32_t replication_factor)
{
triton_ret_t tret;
na_addr_t addr;
int position;
/* we contact the first server (master) for oid */
- tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
+ tret = asg_oid_to_addrs(object, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
- tret = __remote_triton_rpc_rosd_write(addr, container, oid, fork, buffer,
- size, offset, flags, 0, 0, txn_number);
-
+ tret = __remote_triton_rpc_rosd_write(addr, container, object, fork, start_record, recordcount, recordlen, data, flags, update_id_condition, new_update_id, 0, replication_factor);
+
triton_mercury_addr_free(addr);
return(tret);
}
-static __blocking triton_ret_t rosd_write_pull_one_buffer(
+static __blocking triton_ret_t rosd_handle_segment(
hg_handle_t handle,
na_addr_t src_addr,
- char* tmp_buffer,
- int64_t size,
+ na_addr_t next_addr,
+ int my_position,
+ triton_rpc_rosd_write_in_t* in,
+ uint64_t start_record,
int64_t remote_offset,
- hg_bulk_t remote_bulk_handle)
+ uint64_t recordcount)
{
+ char *buffer;
+ triton_ret_t tret;
+ int64_t outsize;
+ struct buffer_mgmt_token *token;
hg_bulk_t bulk_handle = HG_BULK_NULL;
int ret;
struct hg_info *info = NULL;
size_t bulk_size;
+ tret = buffer_mgmt_alloc(rosd_write_buffers, recordcount*in->recordlen, &outsize, &buffer, &token);
+ assert(outsize == recordcount*in->recordlen);
+ if(tret != TRITON_SUCCESS)
+ {
+ return(tret);
+ }
+
info = HG_Get_info(handle);
+ bulk_size = outsize;
- bulk_size = size;
- ret = HG_Bulk_create(info->hg_bulk_class, 1, (void**)&tmp_buffer,
+ ret = HG_Bulk_create(info->hg_bulk_class, 1, (void**)&buffer,
&bulk_size, HG_BULK_WRITE_ONLY, &bulk_handle);
if(ret != HG_SUCCESS)
{
triton_error_msg("HG_Bulk_create() failure.\n");
+ buffer_mgmt_free(token);
return(TRITON_ERR_NOMEM);
}
ret = hg_rsc_bulk_transfer(info->bulk_context, HG_BULK_PULL, src_addr,
- remote_bulk_handle, remote_offset, bulk_handle, 0, bulk_size);
+ in->bulk_handle, remote_offset, bulk_handle, 0, bulk_size);
/* TODO: properly handle cancellations */
assert(ret != AE_ERR_CANCELLED);
if (ret != HG_SUCCESS){
triton_error_msg("hg_rsc_bulk_transfer() failure.\n");
HG_Bulk_free(bulk_handle);
+ buffer_mgmt_free(token);
return(TRITON_ERR_UNKNOWN);
}
-
- /* transfer succeeded, clean up & return */
-
HG_Bulk_free(bulk_handle);
- return TRITON_SUCCESS;
-}
+ tret = rosd_write_do_work(
+ next_addr,
+ buffer,
+ my_position,
+ start_record,
+ recordcount,
+ in);
-static __blocking triton_ret_t rosd_write_run_iteration(
- hg_handle_t handle,
- na_addr_t src_addr,
- na_addr_t next_addr,
- int my_position,
- int from_client_flag,
- triton_rpc_rosd_write_in_t* in,
- aesop_sem_t *sem,
- int64_t* size_remaining,
- int64_t* this_size,
- int64_t *remote_offset,
- int64_t *local_offset,
- struct buffer_mgmt_token **token,
- char** buffer,
- int* more_flag)
-{
- int64_t this_local_offset = 0;
- int64_t this_remote_offset = 0;
- triton_ret_t tret;
-
- *more_flag = 0;
-
- /* calculate how much to transfer in this step */
-
- /* note that this function protects shared variables
- * using a semaphore
- */
- //triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch calling setup_one_buffer().\n");
- tret = rosd_pipeline_setup_one_buffer(
- rosd_write_buffers,
- sem,
- size_remaining,
- remote_offset,
- local_offset,
- this_size,
- &this_local_offset,
- &this_remote_offset,
- token,
- buffer);
- if(triton_is_error(tret))
- {
- return(tret);
- }
- //triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch finished setup_one_buffer(), this_size: %d, this_local_offset: %ld, this_remote_offset %ld.\n", *this_size, this_local_offset, this_remote_offset);
+ buffer_mgmt_free(token);
- if(*this_size > 0)
- {
- /* perform buffer transfer */
- //triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch calling pull_one_buffer().\n");
- tret = rosd_write_pull_one_buffer(
- handle,
- src_addr,
- *buffer,
- *this_size,
- this_remote_offset,
- in->bulk_handle);
- if(triton_is_error(tret))
- {
- return(tret);
- }
-
- //triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch finished pull_one_buffer().\n");
-
- //triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch starting do_work().\n");
- tret = rosd_write_do_work(next_addr, in->container, in->oid,
- in->oid_fork, *buffer, *this_size, this_local_offset,
- in->flags, in->replication_factor, in->txn_number,
- my_position, from_client_flag);
- if(triton_is_error(tret))
- {
- return(tret);
- }
- //triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch finished do_work().\n");
-
- *more_flag = 1;
- }
-
- return(TRITON_SUCCESS);
+ return(tret);
}
-
+
static __blocking triton_ret_t rosd_write_run_pipeline(
hg_handle_t handle,
na_addr_t src_addr,
na_addr_t next_addr,
int my_position,
- int from_client_flag,
triton_rpc_rosd_write_in_t* in
)
{
- int64_t size_remaining = 0;
- int64_t remote_offset = 0;
- int64_t local_offset = 0;
- aesop_sem_t sem;
+ int64_t current_remote_offset = 0;
+ uint64_t current_record = in->start_record;
triton_ret_t out_tret = TRITON_SUCCESS;
- triton_mutex_t output_mutex;
+ triton_mutex_t pipeline_mutex;
+ uint64_t records_per_buffer;
+
+ triton_mutex_init(&pipeline_mutex, NULL);
- size_remaining = in->size;
- local_offset = in->offset;
- remote_offset = 0;
- aesop_sem_init(&sem, 1);
+ records_per_buffer = rosd_write_buffer_size/in->recordlen;
- triton_mutex_init(&output_mutex, NULL);
+ /* TODO: check for zero byte writes somewhere earlier */
+ if(records_per_buffer == 0)
+ {
+ triton_error_msg("record length of %llu is too large.\n", llu(in->recordlen));
+ triton_mutex_destroy(&pipeline_mutex);
+ return(TRITON_ERR_INVAL);
+ }
pwait
{
- pprivate int i = 0;
- pprivate triton_ret_t tret;
- pprivate struct buffer_mgmt_token *token = NULL;
- pprivate char* buffer = NULL;
- pprivate int more_flag = 1;
- pprivate int64_t this_size = 0;
-
- //triton_debug(triton_dbg_rosd,
- // "rosd_write_run_pipeline() starting pwait, size_remaining: %d.\n",
- // size_remaining);
+ pprivate triton_ret_t b_tret;
+ pprivate int i;
+ pprivate uint64_t this_start_record;
+ pprivate int64_t this_remote_offset;
+ pprivate uint64_t this_recordcount;
+
for(i=0; i<rosd_write_xfer_pipeline_depth; i++)
{
pbranch
{
- //triton_debug(triton_dbg_rosd,
- // "rosd_write_run_pipeline() starting pbranch %d.\n", i);
-
- do
- {
- tret = rosd_write_run_iteration(handle, src_addr, next_addr,
- my_position, from_client_flag, in, &sem,
- &size_remaining, &this_size, &remote_offset,
- &local_offset, &token, &buffer, &more_flag);
- }while(more_flag && !triton_is_error(tret));
-
- if(token != NULL)
+ /* calculate which segment this iteration will work on */
+ triton_mutex_lock(&pipeline_mutex);
+ if(current_record >= (in->start_record + in->recordcount))
{
- buffer_mgmt_free(token);
+ triton_mutex_unlock(&pipeline_mutex);
+ pbreak;
}
- //triton_debug(triton_dbg_rosd,
- // "rosd_write_run_pipeline() finishing pbranch %d.\n", i);
- triton_mutex_lock(&output_mutex);
- if(triton_is_error(tret) && !triton_is_error(out_tret))
- {
- out_tret = tret;
- }
- else if(triton_is_error(tret))
+
+ this_start_record = current_record;
+ current_record += records_per_buffer;
+ this_remote_offset = current_remote_offset;
+ current_remote_offset += records_per_buffer * in->recordlen;
+ this_recordcount = records_per_buffer;
+ if(this_recordcount + this_start_record > in->start_record + in->recordcount)
+ this_recordcount = (in->start_record + in->recordcount) - this_start_record;
+ triton_mutex_unlock(&pipeline_mutex);
+
+ triton_debug(triton_dbg_rosd, "rosd_write_run_pipeline() pbranch %d working on records %llu to %llu, remote offset %lld\n", i, llu(this_start_record), llu(this_start_record+this_recordcount), lld(this_remote_offset));
+
+ b_tret = rosd_handle_segment(
+ handle,
+ src_addr,
+ next_addr,
+ my_position,
+ in,
+ this_start_record,
+ this_remote_offset,
+ this_recordcount);
+
+ triton_mutex_lock(&pipeline_mutex);
+ if(triton_is_error(b_tret))
{
- triton_error_destroy(tret);
+ out_tret = b_tret;
}
- triton_mutex_unlock(&output_mutex);
+ triton_mutex_unlock(&pipeline_mutex);
}
}
}
- aesop_sem_destroy(&sem);
- triton_mutex_destroy(&output_mutex);
+ triton_mutex_destroy(&pipeline_mutex);
return(out_tret);
}
+/* This function validates the requested replication factor, storing it on
+ * disk within the object if necessary
+ */
+static __blocking triton_ret_t resolve_replication_factor(
+ triton_rpc_rosd_write_in_t *in)
+{
+ struct sos_grp *grp;
+ struct sos_oid soid;
+ sos_eid_t soid_eids[3];
+ int32_t ondisk_rep_factor;
+ sos_size_t nbytes;
+ sos_update_t update_info;
+ int ret;
+
+ /* TODO: check for "CANCELED" return code from sos once supported. In
+ * that case we need to kick out of this function so that it can be
+ * retried.
+ */
+
+ ret = sos_begin(&grp, NULL, 0, g_sos_ctx);
+ if(ret != 0)
+ {
+ return(TRITON_ERR_IO);
+ }
+
+ if(in->expected_position == 0)
+ {
+ /* This request is intended for the master. Validate replication
+ * factor here against what is stored on disk (if present)
+ */
+
+ soid.nids = 3;
+ soid.ids = soid_eids;
+ soid_eids[0] = in->container;
+ soid_eids[1] = in->object;
+ soid_eids[2] = REP_FACTOR_FORK;
+
+ ret = sos_read(&soid, 0, 1, 0, 0, &ondisk_rep_factor, sizeof(ondisk_rep_factor), &nbytes, &update_info, grp);
+
+ if(ret == 0 && nbytes == sizeof(ondisk_rep_factor))
+ {
+ triton_debug(triton_dbg_rosd, "rosd_write() found on-disk replication factor of %d\n", ondisk_rep_factor);
+
+ if(in->replication_factor == 0)
+ in->replication_factor = ondisk_rep_factor;
+ else if(in->replication_factor != ondisk_rep_factor)
+ {
+ /* caller requested a replication factor that doesn't match
+ * current replication for this object.
+ */
+ triton_error_msg("sos_read() failure for replication factor\n");
+ sos_end(grp, 0);
+ return(TRITON_ERR_IO);
+ }
+ }
+ else
+ {
+ in->flags |= ROSD_FLAG_FIRST_WRITE;
+ }
+ }
+
+ if(in->flags & ROSD_FLAG_FIRST_WRITE)
+ {
+ /* store replication factor on disk */
+ /* this may happen on both master and replicas */
+ if(in->replication_factor == 0)
+ {
+ in->replication_factor = rosd_default_replication_factor;
+ ondisk_rep_factor = rosd_default_replication_factor;
+ }
+ else
+ {
+ ondisk_rep_factor = in->replication_factor;
+ }
+ triton_debug(triton_dbg_rosd, "rosd_write() writing on-disk replication factor of %d\n", ondisk_rep_factor);
+
+ /* write new replication factor to disk */
+ ret = sos_write(&soid, 0, 1, sizeof(ondisk_rep_factor), 0, 0, 1, &ondisk_rep_factor, &nbytes, grp);
+ if(ret != 0 || nbytes != sizeof(ondisk_rep_factor))
+ {
+ triton_error_msg("sos_write() failure for replication factor, return code %d\n", ret);
+ sos_end(grp, 0);
+ return(TRITON_ERR_IO);
+ }
+ }
+
+ ret = sos_end(grp, 1);
+ if(ret != 0)
+ {
+ return(TRITON_ERR_IO);
+ }
+
+ return(TRITON_SUCCESS);
+}
+
static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
{
@@ -313,14 +364,9 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
na_addr_t next_addr;
na_addr_t* addr_array;
int my_position;
- int from_client_flag = 0;
- int64_t obj_offset;
- int64_t size;
- int64_t out_size;
- char* buffer_offsets[1];
- struct txn_nr_cache_entry* entry_p = NULL;
na_addr_t src_addr;
struct hg_info *info = NULL;
+ int test_rep_factor;
triton_debug(triton_dbg_rosd, "Called triton_rpc_rosd_write()\n");
@@ -329,61 +375,108 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
triton_mercury_get_input(handle, &in, &out);
- if(in.replication_factor == 0)
+ triton_debug(triton_dbg_rosd, "rosd_write() with incoming replication factor of %d and incoming expected position of %d\n", in.replication_factor, in.expected_position);
+
+ /* downstream replicas must have replication factor already defined for
+ * them.
+ */
+ if(in.expected_position != 0 && in.replication_factor == 0)
{
- /* replication factor is not known yet; this must be a request from
- * a client */
- if(in.expected_position != 0)
- {
- out.tret = TRITON_ERR_INVAL;
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
- from_client_flag = 1;
+ out.tret = TRITON_ERR_INVAL;
+ triton_mercury_respond(handle, &out);
+ return(TRITON_SUCCESS);
+ }
- /* check our position assuming a replication factor of 1 to make
- * sure that we are the master for this object
+ /* check if this is the correct server for the expected position of the
+ * request chain
+ */
+ if(in.expected_position == 0)
+ {
+ /* this request is intended for the master server */
+
+ /* replication factor may not be known yet; check our position
+ * with an assumed replication factor just to check that we are
+ * first in line.
*/
- out.tret = triton_oid64_to_addrs(in.oid, 1, &my_position, &next_addr);
- if(triton_is_error(out.tret))
- {
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
+ test_rep_factor = 1;
+ }
+ else
+ {
+ test_rep_factor = in.replication_factor;
+ }
+
+ addr_array = malloc(test_rep_factor*sizeof(*addr_array));
+ if(!addr_array)
+ {
+ out.tret = TRITON_ERR_NOMEM;
+ triton_mercury_respond(handle, &out);
+ return(TRITON_SUCCESS);
+ }
- if(my_position != 0)
+ out.tret = asg_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
+ if(triton_is_error(out.tret))
+ {
+ triton_mercury_respond(handle, &out);
+ free(addr_array);
+ return(TRITON_SUCCESS);
+ }
+
+ if(my_position != in.expected_position)
+ {
+ out.tret = TRITON_ERR_WRONG_SERVER;
+ triton_mercury_respond(handle, &out);
+ free(addr_array);
+ return(TRITON_SUCCESS);
+ }
+
+ /* now check that the replication factor is valid and store it on disk
+ * if needed
+ * NOTE: wrapped in a loop to handle sos txn retries
+ */
+ /* TODO: fix error codes; need to differentiate sos canceled (which
+ * means we should retry) from aesop canceled (which means the operation
+ * has been explicitly canceled by another thread, likely due to error
+ * cleanup)
+ */
+ out.tret = TRITON_ERR_CANCELED;
+ while(triton_error_equal(out.tret, TRITON_ERR_CANCELED))
+ {
+ out.tret = resolve_replication_factor(&in);
+ }
+
+ if(in.replication_factor > test_rep_factor)
+ {
+ /* earlier replication factor assumption was wrong; look up mapping
+ * again
+ */
+ free(addr_array);
+ addr_array = malloc(test_rep_factor*sizeof(*addr_array));
+ if(!addr_array)
{
- out.tret = TRITON_ERR_WRONG_SERVER;
+ out.tret = TRITON_ERR_NOMEM;
triton_mercury_respond(handle, &out);
return(TRITON_SUCCESS);
}
- /* retrieve the true replication factor from the object */
- obj_offset = 0;
- buffer_offsets[0] = (char*)&in.replication_factor;
- size = sizeof(in.replication_factor);
- out.tret = TRITON_ERR_NOT_IMPLEMENTED;
- /* TODO: REPLACEME
- out.tret = tosd_read(in.oid, REP_FACTOR_FORK, buffer_offsets,
- &size, 1, &obj_offset, &size, 1, &out_size, 0);
- */
+ out.tret = asg_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
if(triton_is_error(out.tret))
{
- triton_error_msg("tosd_read() failure for replication factor\n");
triton_mercury_respond(handle, &out);
+ free(addr_array);
return(TRITON_SUCCESS);
}
- if(out_size != sizeof(in.replication_factor))
- {
- assert(out_size == 0);
- in.replication_factor = rosd_default_replication_factor;
- }
+ }
- /* TODO: check flags to make sure this isn't an explicit conditional */
+ /* TODO: check flags to make sure this isn't an explicit conditional */
+ /* TODO: revise txn_nr_cache to query correct version number out of
+ * SOS; for now we just hard code version number to 0.
+ */
+#if 0
+ if(in.expected_position == 0)
+ {
/* figure out what transaction number to use */
- out.tret = txn_nr_cache_get(&entry_p, in.container, in.oid,
- &in.txn_number, in.flags);
+ out.tret = txn_nr_cache_get(&entry_p, in.object, &in.update_id_condition, in.flags);
if(triton_is_error(out.tret))
{
triton_error_msg("txn_nr_cache_get() failure.\n");
@@ -391,49 +484,24 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
return(TRITON_SUCCESS);
}
}
-
- /* map oid to server addresses */
- addr_array = malloc(in.replication_factor*sizeof(*addr_array));
- if(!addr_array)
- {
- if(entry_p)
- txn_nr_cache_put(entry_p);
- out.tret = TRITON_ERR_NOMEM;
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
+#else
+ in.update_id_condition = 0;
+#endif
- out.tret = triton_oid64_to_addrs(in.oid, in.replication_factor,
- &my_position, addr_array);
- if(triton_is_error(out.tret))
- {
- if(entry_p)
- txn_nr_cache_put(entry_p);
- free(addr_array);
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
-
- /* check position in chain */
- if(my_position != in.expected_position)
- {
- if(entry_p)
- txn_nr_cache_put(entry_p);
- out.tret = TRITON_ERR_WRONG_SERVER;
- free(addr_array);
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
if(my_position < (in.replication_factor-1))
{
next_addr = addr_array[my_position+1];
}
+
+ triton_debug(triton_dbg_rosd, "rosd_write() triggered, running pipeline.\n");
out.tret = rosd_write_run_pipeline(handle, src_addr, next_addr, my_position,
- from_client_flag, &in);
+ &in);
+#if 0
if(entry_p)
txn_nr_cache_put(entry_p);
+#endif
triton_mercury_respond(handle, &out);
free(addr_array);
@@ -464,37 +532,38 @@ void triton_rpc_rosd_write_register(void)
static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
na_addr_t addr,
uint64_t container,
- uint64_t oid,
+ uint64_t object,
uint64_t fork,
- char* buffer,
- int64_t size,
- int64_t offset,
+ uint64_t start_record,
+ uint64_t recordcount,
+ uint64_t recordlen,
+ void* data,
uint32_t flags,
- uint32_t replication_factor,
+ uint64_t update_id_condition,
+ uint64_t *new_update_id,
uint32_t expected_position,
- uint64_t txn_number)
+ uint32_t replication_factor)
{
triton_rpc_rosd_write_out_t out;
triton_rpc_rosd_write_in_t in;
int ret;
triton_ret_t tret;
hg_handle_t handle = HG_HANDLE_NULL;
- size_t bulk_size = size;
-
- in.container = container;
- in.oid = oid;
- in.oid_fork = fork;
- in.offset = offset;
- in.size = size;
- in.offset = offset;
+ size_t bulk_size = recordcount*recordlen;
+
+ in.object = object;
+ in.fork = fork;
+ in.start_record = start_record;
+ in.recordcount = recordcount;
+ in.recordlen = recordlen;
in.flags = flags;
+ in.update_id_condition = update_id_condition;
in.replication_factor = replication_factor;
in.expected_position = expected_position;
- in.txn_number = txn_number;
in.bulk_handle = HG_BULK_NULL;
triton_mercury_run_rpc_with_bulk(addr, rpc_rosd_write_id, handle,
- &in, &out, in.bulk_handle, buffer, bulk_size, HG_BULK_READ_ONLY);
+ &in, &out, in.bulk_handle, data, bulk_size, HG_BULK_READ_ONLY);
tret = triton_error_dup(out.tret);
@@ -506,56 +575,70 @@ static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
static __blocking triton_ret_t rosd_write_do_work(
na_addr_t next_addr,
- uint64_t container,
- uint64_t oid,
- uint64_t oid_fork,
char* buffer,
- int64_t size,
- int64_t offset,
- uint32_t flags,
- uint32_t replication_factor,
- uint64_t txn_number,
int my_position,
- int from_client_flag)
+ uint64_t start_record,
+ uint64_t recordcount,
+ triton_rpc_rosd_write_in_t* in)
{
triton_ret_t local_tret;
triton_ret_t remote_tret = TRITON_SUCCESS;
triton_ret_t tret;
+ uint64_t new_update_id;
/* right now only chained replication is supported */
- assert(!(flags & ROSD_FLAG_FANOUT));
- flags |= ROSD_FLAG_CHAIN;
+ assert(!(in->flags & ROSD_FLAG_FANOUT));
+ in->flags |= ROSD_FLAG_CHAIN;
- /* TODO: implement conditionals */
pwait
{
pbranch
{
/* forward on to peers if necessary */
- if(my_position < replication_factor-1)
+ if(my_position < in->replication_factor-1)
{
- triton_debug(triton_dbg_rosd, "ROSD forwarding write of oid %lu to %d'th server.\n", oid, my_position+1);
+ triton_debug(triton_dbg_rosd, "ROSD forwarding write of oid %llu to %d'th server.\n", llu(in->object), my_position+1);
remote_tret = __remote_triton_rpc_rosd_write(
- next_addr, container, oid, oid_fork, buffer, size, offset,
- flags, replication_factor, my_position+1, txn_number);
+ next_addr, in->container, in->object, in->fork,
+ start_record, recordcount, in->recordlen, buffer,
+ in->flags, in->update_id_condition, &new_update_id,
+ my_position+1, in->replication_factor);
}
}
pbranch
{
- triton_debug(triton_dbg_rosd, "ROSD local write of oid %lu on %d'th server, transaction number %llu.\n", oid, my_position, llu(txn_number));
+ triton_debug(triton_dbg_rosd, "ROSD local write of oid %llu on %d'th server, update_id %llu.\n", llu(in->object), my_position, llu(in->update_id_condition));
/* perform local operation */
- local_tret = rosd_write_local_storage(container, oid, oid_fork,
- txn_number, buffer, size, offset, flags);
+ /* TODO: fix error codes; need to differentiate sos canceled (which
+ * means we should retry) from aesop canceled (which means the operation
+ * has been explicitly canceled by another thread, likely due to error
+ * cleanup)
+ */
+ local_tret = TRITON_ERR_CANCELED;
+ while(local_tret == TRITON_ERR_CANCELED)
+ {
+ local_tret = rosd_write_local_storage(
+ in->container,
+ in->object,
+ in->fork,
+ start_record,
+ recordcount,
+ in->recordlen,
+ buffer,
+ 0,
+ in->update_id_condition,
+ &new_update_id);
+ }
}
}
- if(my_position < replication_factor-1)
+ if(my_position < in->replication_factor-1)
tret = interpret_errors(local_tret, remote_tret, my_position,
- is_usage_error_write, from_client_flag);
+ is_usage_error_write, !in->expected_position);
else
tret = interpret_error(local_tret, my_position, is_usage_error_write,
- from_client_flag);
+ !in->expected_position);
return(tret);
}
@@ -584,48 +667,56 @@ static int is_usage_error_write(triton_ret_t tret)
return(0);
}
-/* rosd_write_local_storage()
- *
- * performs the local steps needed in a replicated write
- */
static __blocking triton_ret_t rosd_write_local_storage(
uint64_t container,
- uint64_t oid,
- uint64_t oid_fork,
- uint64_t txn_number,
- char *buffer,
- int64_t size,
- int64_t offset,
- uint32_t flags
-)
+ uint64_t object,
+ uint64_t fork,
+ uint64_t start_record,
+ uint64_t recordcount,
+ uint64_t recordlen,
+ char* buffer,
+ uint32_t flags,
+ uint64_t update_id_condition,
+ uint64_t *new_update_id)
{
- triton_ret_t tret;
- uint64_t niid = 0;
- int value = 0;
- char* buffer_offsets[1];
- triton_node_t self;
-
- /* TODO: REPLACEME
- int tosd_flags = TOSD_FLAG_AUTO_TXN;
- if(flags & ROSD_FLAG_TRUNC_WRITE)
- tosd_flags |= TOSD_FLAG_TRUNC_WRITE;
- */
-
- /* NOTE: a typical write is idempotent; no need for niid information
- * here
+ struct sos_grp *grp;
+ struct sos_oid soid;
+ sos_eid_t soid_eids[3];
+ sos_size_t nbytes;
+ sos_update_t update_info;
+ int ret;
+
+ /* TODO: handle canceled error code (or whatever sos will report to
+ * indicate that a txn failed and should be retried)
*/
- buffer_offsets[0] = buffer;
- tret = TRITON_ERR_NOT_IMPLEMENTED;
- /* TODO: REPLACEME
- tret = tosd_write(oid, oid_fork, txn_number, buffer_offsets, &size,
- 1, &offset, &size, 1, tosd_flags, 0, NULL);
- */
- if(triton_is_error(tret))
+ ret = sos_begin(&grp, NULL, 0, g_sos_ctx);
+ if(ret != 0)
{
- triton_error_msg("tosd_write() failure.\n");
+ return(TRITON_ERR_IO);
}
- return(tret);
+ soid.nids = 3;
+ soid.ids = soid_eids;
+ soid_eids[0] = container;
+ soid_eids[1] = object;
+ soid_eids[2] = fork;
+
+ /* TODO: the update id arguments probably aren't right here... */
+ ret = sos_write(&soid, start_record, recordcount, recordlen, 0, 0, update_id_condition, buffer, &nbytes, grp);
+ if(ret != 0 || nbytes != recordcount*recordlen)
+ {
+ triton_error_msg("sos_write() failure, return code %d\n", ret);
+ sos_end(grp, 0);
+ return(TRITON_ERR_IO);
+ }
+
+ ret = sos_end(grp, 1);
+ if(ret != 0)
+ {
+ return(TRITON_ERR_IO);
+ }
+
+ return(TRITON_SUCCESS);
}
diff --git a/code/src/replicated-osd/rosd.ae b/code/src/replicated-osd/rosd.ae
index 91455ad..051320c 100644
--- a/code/src/replicated-osd/rosd.ae
+++ b/code/src/replicated-osd/rosd.ae
@@ -170,11 +170,9 @@ void triton_rpc_rosd_register(void)
triton_rpc_rosd_remove_register();
triton_rpc_rosd_write_register();
triton_rpc_rosd_read_register();
- triton_rpc_rsos_read_register();
triton_rpc_rosd_probe_fork_register();
triton_rpc_rosd_probe_object_register();
triton_rpc_rosd_reset_register();
- triton_rpc_rsos_write_register();
return;
}
diff --git a/code/src/replicated-osd/rosd.hae b/code/src/replicated-osd/rosd.hae
index 2ff39ca..89b642a 100644
--- a/code/src/replicated-osd/rosd.hae
+++ b/code/src/replicated-osd/rosd.hae
@@ -56,17 +56,6 @@ __blocking triton_ret_t remote_triton_rpc_rosd_range(
/* TODO: make const correct (needs some downstream fixes also) */
__blocking triton_ret_t remote_triton_rpc_rosd_write(
uint64_t container,
- uint64_t oid,
- uint64_t fork,
- char* buffer,
- int64_t size,
- int64_t offset,
- uint64_t txn_number,
- uint32_t flags);
-
-/* TODO: make const correct (needs some downstream fixes also) */
-__blocking triton_ret_t remote_triton_rpc_rsos_write(
- uint64_t container,
uint64_t object,
uint64_t fork,
uint64_t start_record,
@@ -79,27 +68,16 @@ __blocking triton_ret_t remote_triton_rpc_rsos_write(
uint32_t replication_factor);
__blocking triton_ret_t remote_triton_rpc_rosd_read(
- uint64_t container,
- uint64_t oid,
- uint64_t fork,
- char* buffer,
- int64_t size,
- int64_t offset,
- uint64_t* out_txn_number,
- int64_t* out_size,
- uint32_t flags);
-
-__blocking triton_ret_t remote_triton_rpc_rsos_read(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- int flags,
- void * buf,
- uint64_t buf_size,
- uint64_t * version_info,
- uint64_t * transferred);
+ uint64_t container,
+ uint64_t object,
+ uint64_t fork,
+ uint64_t start_record,
+ uint64_t recordcount,
+ int flags,
+ void * buf,
+ uint64_t buf_size,
+ uint64_t * version_info,
+ uint64_t * transferred);
__blocking triton_ret_t rosd_pipeline_setup_one_buffer(
struct buffer_mgmt_instance* buffer_instance,
diff --git a/code/src/replicated-osd/rsos-read.ae b/code/src/replicated-osd/rsos-read.ae
deleted file mode 100644
index b5c8464..0000000
--- a/code/src/replicated-osd/rsos-read.ae
+++ /dev/null
@@ -1,371 +0,0 @@
-#include <aesop/aesop.h>
-#include <aesop/timer.hae>
-#include <aesop/sem.hae>
-#include <triton-list.h>
-#include <triton-hash.h>
-#include <mercury_macros.h>
-#include <mercury_proc.h>
-
-#include "src/replicated-osd/rosd.hae"
-#include "src/replicated-osd/rosd-internal.hae"
-#include "src/replicated-osd/rosd-txn-nr-cache.hae"
-#include "src/replicated-osd/buffer-mgmt.hae"
-#include "src/common/triton-debug.h"
-#include "src/common/self.h"
-#include "src/placement/placement.h"
-#include "src/system-state/system-state.hae"
-#include "src/remote/mercury-engine.hae"
-#include "src/remote/mercury-encode.h"
-#include "src/system-state/system-state.hae"
-
-/* this is the number of concurrent buffers/transfers that the ROSD will
- * keep in flight for a single read operation
- */
-extern int64_t rosd_read_xfer_pipeline_depth;
-
-/* Mercury RPC structures for rosd_read */
-MERCURY_GEN_PROC(triton_rpc_rsos_read_in_t,
- ((uint64_t)(container))\
- ((uint64_t)(object))\
- ((uint64_t)(fork))\
- ((uint64_t)(start_record))\
- ((uint64_t)(recordcount))\
- ((uint32_t)(flags))\
- ((hg_bulk_t)(bulk_handle))\
- ((uint64_t)(buf_size)))
-
-MERCURY_GEN_PROC(triton_rpc_rsos_read_out_t,
- ((triton_ret_t)(tret))\
- ((int64_t)(out_size))\
- ((uint64_t)(txn_number)))
-
-static hg_id_t rpc_rsos_read_id;
-static __blocking triton_ret_t triton_rpc_rsos_read(hg_handle_t handle);
-static hg_return_t triton_rpc_rsos_read_handler(hg_handle_t handle);
-
-extern struct buffer_mgmt_instance* rosd_read_buffers;
-
-__blocking triton_ret_t remote_triton_rpc_rsos_read(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- int flags,
- void * buf,
- uint64_t buf_size,
- uint64_t * version_info,
- uint64_t * transferred)
-{
- triton_rpc_rsos_read_out_t out;
- triton_rpc_rsos_read_in_t in;
- int ret;
- triton_ret_t tret;
- na_addr_t addr;
- int position;
- size_t bulk_size;
- hg_handle_t handle;
-
- /* TODO: ability read from replicas as well */
- /* we contact the first server (master) for oid */
- tret = asg_oid_to_addrs(object, 1, &position, &addr);
- if(triton_is_error(tret))
- {
- return(tret);
- }
-
- in.container = container;
- in.object = object;
- in.fork = fork;
- in.start_record = start_record;
- in.recordcount = recordcount;
- in.flags = flags;
- in.buf_size = buf_size;
- in.flags = flags;
- in.bulk_handle = HG_BULK_NULL;
- bulk_size = (size_t) buf_size;
-
- triton_mercury_run_rpc_with_bulk(addr, rpc_rsos_read_id, handle,
- &in, &out, in.bulk_handle, buf, bulk_size, HG_BULK_WRITE_ONLY);
-
- triton_mercury_addr_free(addr);
-
- tret = triton_error_dup(out.tret);
- if(!triton_is_error(tret))
- {
- *transferred = out.out_size;
- *version_info = out.txn_number;
- }
- else
- {
- *transferred = 0;
- *version_info = 0;
- }
-
- HG_Free_output(handle, &out);
-
- HG_Destroy(handle);
-
- return(tret);
-
-}
-
-#if 0
-/* TODO: convert me to rsos */
-static __blocking triton_ret_t rosd_read_xfer_one_buffer(
- struct hg_info *hg_info,
- char* tmp_buffer,
- uint128_t oid,
- uint64_t fork,
- int64_t size,
- int64_t offset,
- int64_t remote_offset,
- hg_bulk_t remote_bulk_handle,
- int64_t *out_size,
- uint64_t *txn_number)
-{
- triton_ret_t tret;
- hg_bulk_t bulk_handle = HG_BULK_NULL;
- int ret;
-
- tret = tosd_read_versioned(
- oid,
- fork,
- &tmp_buffer,
- &size,
- 1,
- &offset,
- &size,
- 1,
- out_size,
- 0,
- txn_number);
-
- if(triton_is_error(tret))
- {
- return(tret);
- }
-
- /* zero byte read; don't try to do bulk transfer */
- if((*out_size) == 0)
- {
- return(TRITON_SUCCESS);
- }
-
- /* TODO: fix types for arguments here... */
- ret = HG_Bulk_create(hg_info->hg_bulk_class, 1, (void**)&tmp_buffer, (size_t*)out_size, HG_BULK_READ_ONLY, &bulk_handle);
- if(ret != HG_SUCCESS)
- {
- triton_error_msg("HG_Bulk_create() failure.\n");
- return(TRITON_ERR_NOMEM);
- }
-
- ret = hg_rsc_bulk_transfer(hg_info->bulk_context, HG_BULK_PUSH,
- hg_info->addr, remote_bulk_handle, remote_offset, bulk_handle, 0, *out_size);
- if(ret != HG_SUCCESS)
- {
- triton_error_msg("HG_Bulk_write() failure.\n");
- HG_Bulk_free(bulk_handle);
- return(TRITON_ERR_UNKNOWN);
- }
-
- HG_Bulk_free(bulk_handle);
-
- return(tret);
-}
-#endif
-
-static __blocking triton_ret_t triton_rpc_rsos_read(hg_handle_t handle)
-{
- triton_rpc_rsos_read_out_t out;
- triton_rpc_rsos_read_in_t in;
- na_addr_t next_addr;
- int my_position;
- int ret;
- int64_t size_remaining = 0;
- int64_t remote_offset = 0;
- int64_t local_offset = 0;
- aesop_sem_t sem;
- triton_mutex_t output_mutex;
- struct hg_info *hg_info = NULL;
-
- triton_debug(triton_dbg_rosd, "Called triton_rpc_rsos_read()\n");
-
- hg_info = HG_Get_info(handle);
-
- triton_mercury_get_input(handle, &in, &out);
-
- /* TODO: ability to read from replicas */
- /* check our position assuming a replication factor of 1 to make
- * sure that we are the master for this object
- */
- out.tret = asg_oid_to_addrs(in.object, 1, &my_position, &next_addr);
- if(triton_is_error(out.tret))
- {
- triton_mercury_respond(handle, &out);
- HG_Destroy(handle);
- return(TRITON_SUCCESS);
- }
-
- if(my_position != 0)
- {
- out.tret = TRITON_ERR_WRONG_SERVER;
- triton_mercury_respond(handle, &out);
- HG_Destroy(handle);
- return(TRITON_SUCCESS);
- }
-
- out.tret = TRITON_ERR_UNKNOWN;
- out.out_size = 0;
- out.txn_number = 0;
- triton_mercury_respond(handle, &out);
- HG_Destroy(handle);
- return(TRITON_SUCCESS);
-
-#if 0
- /* TODO: convert to rsos */
- size_remaining = in.size;
- local_offset = in.offset;
- remote_offset = 0;
- aesop_sem_init(&sem, 1);
- triton_mutex_init(&output_mutex, NULL);
-
- pwait
- {
- pprivate int i = 0;
- pprivate int64_t this_size = 0;
- pprivate int64_t this_out_size = 0;
- pprivate int64_t this_local_offset = 0;
- pprivate int64_t this_remote_offset = 0;
- pprivate struct buffer_mgmt_token *token = NULL;
- pprivate char* buffer = NULL;
- pprivate triton_ret_t tret;
- pprivate uint64_t this_txn_number = 0;
-
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() in pwait, size_remaining: %d.\n", size_remaining);
- for(i=0; i<rosd_read_xfer_pipeline_depth; i++)
- {
- pbranch
- {
- do
- {
- /* calculate how much to transfer in this step */
- /* note that this function protects shared variables
- * using a semaphore
- */
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() pbranch %d calling setup_one_buffer().\n", i);
- tret = rosd_pipeline_setup_one_buffer(
- rosd_read_buffers,
- &sem,
- &size_remaining,
- &remote_offset,
- &local_offset,
- &this_size,
- &this_local_offset,
- &this_remote_offset,
- &token,
- &buffer);
- triton_mutex_lock(&output_mutex);
- if(triton_is_error(tret) && !triton_is_error(out.tret))
- {
- out.tret = tret;
- this_size = 0;
- }
- else if(triton_is_error(tret))
- {
- triton_error_destroy(tret);
- }
- triton_mutex_unlock(&output_mutex);
-
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() pbranch %d finished setup_one_buffer(), size_remaining: %d.\n", i, size_remaining);
-
- if(this_size > 0)
- {
- /* perform buffer transfer */
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() pbranch %d calling xfer_one_buffer().\n", i);
- tret = rosd_read_xfer_one_buffer(
- hg_info,
- buffer,
- in.oid,
- in.oid_fork,
- this_size,
- this_local_offset,
- this_remote_offset,
- in.bulk_handle,
- &this_out_size,
- &this_txn_number);
-
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() pbranch %d finished xfer_one_buffer().\n", i);
- /* accumulate results in rpc response */
- triton_mutex_lock(&output_mutex);
- if(triton_is_error(tret) && !triton_is_error(out.tret))
- {
- out.tret = tret;
- }
- else if(triton_is_error(tret))
- {
- triton_error_destroy(tret);
- }
- else
- {
- out.out_size += this_out_size;
- if(out.txn_number == 0 && out.txn_number == this_txn_number)
- out.txn_number = this_txn_number;
- else
- {
- /* TODO: what are we supposed to do on mixed txn
- * numbers?
- */
- out.txn_number = 0;
- }
- }
- triton_mutex_unlock(&output_mutex);
- }
- else
- {
- this_out_size = this_size;
- }
- }while(this_out_size > 0 && !triton_is_error(out.tret));
-
- if(token != NULL)
- {
- buffer_mgmt_free(token);
- }
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() done with pbranch %d.\n", i);
- }
- }
- }
- //triton_debug(triton_dbg_rosd, "triton_rpc_rsos_read() done with pwait.\n");
-
- aesop_sem_destroy(&sem);
- triton_mutex_destroy(&output_mutex);
-
- triton_mercury_respond(handle, &out);
- HG_Destroy(handle);
-
- return(TRITON_SUCCESS);
-#endif
-}
-TRITON_DEFINE_RPC_HANDLER(triton_rpc_rsos_read)
-
-void triton_rpc_rsos_read_register(void)
-{
- hg_class_t* hg_class = NULL;
-
- hg_class = triton_mercury_engine_get_class();
-
- rpc_rsos_read_id = MERCURY_REGISTER(hg_class, "triton_rpc_rsos_read",
- triton_rpc_rsos_read_in_t,
- triton_rpc_rsos_read_out_t,
- triton_rpc_rsos_read_handler);
-
- return;
-}
-
-/*
- * Local Variables:
- * c-basic-offset: 4
- * End:
- *
- * vim: ft=c ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/src/replicated-osd/rsos-write.ae b/code/src/replicated-osd/rsos-write.ae
deleted file mode 100644
index 98b6580..0000000
--- a/code/src/replicated-osd/rsos-write.ae
+++ /dev/null
@@ -1,729 +0,0 @@
-#include <aesop/aesop.h>
-#include <aesop/timer.hae>
-#include <triton-list.h>
-#include <triton-hash.h>
-#include <mercury_macros.h>
-#include <mercury_proc.h>
-#include <assert.h>
-#include <sos.hae>
-
-#include "src/replicated-osd/rosd.hae"
-#include "src/replicated-osd/rosd-internal.hae"
-#include "src/replicated-osd/rosd-txn-nr-cache.hae"
-#include "src/common/triton-debug.h"
-#include "src/common/self.h"
-#include "src/placement/placement.h"
-#include "src/system-state/system-state.hae"
-#include "src/remote/mercury-engine.hae"
-#include "src/remote/mercury-encode.h"
-#include "src/system-state/system-state.hae"
-
-/* this is the number of concurrent buffers/transfers that the ROSD will
- * keep in flight for a single write operation
- */
-extern int64_t rosd_write_xfer_pipeline_depth;
-extern struct sos_ctx* g_sos_ctx;
-extern int64_t rosd_write_buffer_size;
-
-/* Mercury RPC structures for rsos_write */
-MERCURY_GEN_PROC(triton_rpc_rsos_write_out_t,
- ((triton_ret_t)(tret))\
- ((uint64_t)(new_update_id)))
-
-MERCURY_GEN_PROC(triton_rpc_rsos_write_in_t,
- ((uint64_t)(container))\
- ((uint64_t)(object))\
- ((uint64_t)(fork))\
- ((uint64_t)(start_record))\
- ((uint64_t)(recordcount))\
- ((uint64_t)(recordlen))\
- ((uint32_t)(flags))\
- ((uint64_t)(update_id_condition))\
- ((uint32_t)(expected_position))\
- ((uint32_t)(replication_factor))\
- ((hg_bulk_t)(bulk_handle)))
-
-extern struct buffer_mgmt_instance* rosd_write_buffers;
-static hg_id_t rpc_rsos_write_id;
-static __blocking triton_ret_t triton_rpc_rsos_write(hg_handle_t handle);
-static hg_return_t triton_rpc_rsos_write_handler(hg_handle_t handle);
-static __blocking triton_ret_t __remote_triton_rpc_rsos_write(
- na_addr_t addr,
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- uint64_t recordlen,
- void* data,
- uint32_t flags,
- uint64_t update_id_condition,
- uint64_t *new_update_id,
- uint32_t expected_position,
- uint32_t replication_factor);
-static int is_usage_error_write(triton_ret_t tret);
-static __blocking triton_ret_t resolve_replication_factor(
- triton_rpc_rsos_write_in_t *in);
-static __blocking triton_ret_t rsos_write_do_work(
- na_addr_t next_addr,
- char* buffer,
- int my_position,
- uint64_t start_record,
- uint64_t recordcount,
- triton_rpc_rsos_write_in_t* in);
-
-static __blocking triton_ret_t rosd_write_local_storage(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- uint64_t recordlen,
- char* buffer,
- uint32_t flags,
- uint64_t update_id_condition,
- uint64_t *new_update_id);
-
-__blocking triton_ret_t remote_triton_rpc_rsos_write(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- uint64_t recordlen,
- void* data,
- uint32_t flags,
- uint64_t update_id_condition,
- uint64_t *new_update_id,
- uint32_t replication_factor)
-{
- triton_ret_t tret;
- na_addr_t addr;
- int position;
-
- /* we contact the first server (master) for oid */
- tret = asg_oid_to_addrs(object, 1, &position, &addr);
- if(triton_is_error(tret))
- {
- return(tret);
- }
-
- tret = __remote_triton_rpc_rsos_write(addr, container, object, fork, start_record, recordcount, recordlen, data, flags, update_id_condition, new_update_id, 0, replication_factor);
-
- triton_mercury_addr_free(addr);
-
- return(tret);
-
-}
-
-static __blocking triton_ret_t rsos_handle_segment(
- hg_handle_t handle,
- na_addr_t src_addr,
- na_addr_t next_addr,
- int my_position,
- triton_rpc_rsos_write_in_t* in,
- uint64_t start_record,
- int64_t remote_offset,
- uint64_t recordcount)
-{
- char *buffer;
- triton_ret_t tret;
- int64_t outsize;
- struct buffer_mgmt_token *token;
- hg_bulk_t bulk_handle = HG_BULK_NULL;
- int ret;
- struct hg_info *info = NULL;
- size_t bulk_size;
-
- tret = buffer_mgmt_alloc(rosd_write_buffers, recordcount*in->recordlen, &outsize, &buffer, &token);
- assert(outsize == recordcount*in->recordlen);
- if(tret != TRITON_SUCCESS)
- {
- return(tret);
- }
-
- info = HG_Get_info(handle);
- bulk_size = outsize;
-
- ret = HG_Bulk_create(info->hg_bulk_class, 1, (void**)&buffer,
- &bulk_size, HG_BULK_WRITE_ONLY, &bulk_handle);
- if(ret != HG_SUCCESS)
- {
- triton_error_msg("HG_Bulk_create() failure.\n");
- buffer_mgmt_free(token);
- return(TRITON_ERR_NOMEM);
- }
-
- ret = hg_rsc_bulk_transfer(info->bulk_context, HG_BULK_PULL, src_addr,
- in->bulk_handle, remote_offset, bulk_handle, 0, bulk_size);
- /* TODO: properly handle cancellations */
- assert(ret != AE_ERR_CANCELLED);
- if (ret != HG_SUCCESS){
- triton_error_msg("hg_rsc_bulk_transfer() failure.\n");
- HG_Bulk_free(bulk_handle);
- buffer_mgmt_free(token);
- return(TRITON_ERR_UNKNOWN);
- }
- HG_Bulk_free(bulk_handle);
-
- tret = rsos_write_do_work(
- next_addr,
- buffer,
- my_position,
- start_record,
- recordcount,
- in);
-
- buffer_mgmt_free(token);
-
- return(tret);
-}
-
-static __blocking triton_ret_t rsos_write_run_pipeline(
- hg_handle_t handle,
- na_addr_t src_addr,
- na_addr_t next_addr,
- int my_position,
- triton_rpc_rsos_write_in_t* in
-)
-{
- int64_t current_remote_offset = 0;
- uint64_t current_record = in->start_record;
- triton_ret_t out_tret = TRITON_SUCCESS;
- triton_mutex_t pipeline_mutex;
- uint64_t records_per_buffer;
-
- triton_mutex_init(&pipeline_mutex, NULL);
-
- records_per_buffer = rosd_write_buffer_size/in->recordlen;
-
- /* TODO: check for zero byte writes somewhere earlier */
- if(records_per_buffer == 0)
- {
- triton_error_msg("record length of %llu is too large.\n", llu(in->recordlen));
- triton_mutex_destroy(&pipeline_mutex);
- return(TRITON_ERR_INVAL);
- }
-
- pwait
- {
- pprivate triton_ret_t b_tret;
- pprivate int i;
- pprivate uint64_t this_start_record;
- pprivate int64_t this_remote_offset;
- pprivate uint64_t this_recordcount;
-
- for(i=0; i<rosd_write_xfer_pipeline_depth; i++)
- {
- pbranch
- {
- /* calculate which segment this iteration will work on */
- triton_mutex_lock(&pipeline_mutex);
- if(current_record >= (in->start_record + in->recordcount))
- {
- triton_mutex_unlock(&pipeline_mutex);
- pbreak;
- }
-
- this_start_record = current_record;
- current_record += records_per_buffer;
- this_remote_offset = current_remote_offset;
- current_remote_offset += records_per_buffer * in->recordlen;
- this_recordcount = records_per_buffer;
- if(this_recordcount + this_start_record > in->start_record + in->recordcount)
- this_recordcount = (in->start_record + in->recordcount) - this_start_record;
- triton_mutex_unlock(&pipeline_mutex);
-
- triton_debug(triton_dbg_rosd, "rsos_write_run_pipeline() pbranch %d working on records %llu to %llu, remote offset %lld\n", i, llu(this_start_record), llu(this_start_record+this_recordcount), lld(this_remote_offset));
-
- b_tret = rsos_handle_segment(
- handle,
- src_addr,
- next_addr,
- my_position,
- in,
- this_start_record,
- this_remote_offset,
- this_recordcount);
-
- triton_mutex_lock(&pipeline_mutex);
- if(triton_is_error(b_tret))
- {
- out_tret = b_tret;
- }
- triton_mutex_unlock(&pipeline_mutex);
- }
- }
- }
-
- triton_mutex_destroy(&pipeline_mutex);
- return(out_tret);
-}
-
-/* This function validates the requested replication factor, storing it on
- * disk within the object if necessary
- */
-static __blocking triton_ret_t resolve_replication_factor(
- triton_rpc_rsos_write_in_t *in)
-{
- struct sos_grp *grp;
- struct sos_oid soid;
- sos_eid_t soid_eids[3];
- int32_t ondisk_rep_factor;
- sos_size_t nbytes;
- sos_update_t update_info;
- int ret;
-
- /* TODO: check for "CANCELED" return code from sos once supported. In
- * that case we need to kick out of this function so that it can be
- * retried.
- */
-
- ret = sos_begin(&grp, NULL, 0, g_sos_ctx);
- if(ret != 0)
- {
- return(TRITON_ERR_IO);
- }
-
- if(in->expected_position == 0)
- {
- /* This request is intended for the master. Validate replication
- * factor here against what is stored on disk (if present)
- */
-
- soid.nids = 3;
- soid.ids = soid_eids;
- soid_eids[0] = in->container;
- soid_eids[1] = in->object;
- soid_eids[2] = REP_FACTOR_FORK;
-
- ret = sos_read(&soid, 0, 1, 0, 0, &ondisk_rep_factor, sizeof(ondisk_rep_factor), &nbytes, &update_info, grp);
-
- if(ret == 0 && nbytes == sizeof(ondisk_rep_factor))
- {
- triton_debug(triton_dbg_rosd, "rsos_write() found on-disk replication factor of %d\n", ondisk_rep_factor);
-
- if(in->replication_factor == 0)
- in->replication_factor = ondisk_rep_factor;
- else if(in->replication_factor != ondisk_rep_factor)
- {
- /* caller requested a replication factor that doesn't match
- * current replication for this object.
- */
- triton_error_msg("sos_read() failure for replication factor\n");
- sos_end(grp, 0);
- return(TRITON_ERR_IO);
- }
- }
- else
- {
- in->flags |= ROSD_FLAG_FIRST_WRITE;
- }
- }
-
- if(in->flags & ROSD_FLAG_FIRST_WRITE)
- {
- /* store replication factor on disk */
- /* this may happen on both master and replicas */
- if(in->replication_factor == 0)
- {
- in->replication_factor = rosd_default_replication_factor;
- ondisk_rep_factor = rosd_default_replication_factor;
- }
- else
- {
- ondisk_rep_factor = in->replication_factor;
- }
- triton_debug(triton_dbg_rosd, "rsos_write() writing on-disk replication factor of %d\n", ondisk_rep_factor);
-
- /* write new replication factor to disk */
- ret = sos_write(&soid, 0, 1, sizeof(ondisk_rep_factor), 0, 0, 1, &ondisk_rep_factor, &nbytes, grp);
- if(ret != 0 || nbytes != sizeof(ondisk_rep_factor))
- {
- triton_error_msg("sos_write() failure for replication factor, return code %d\n", ret);
- sos_end(grp, 0);
- return(TRITON_ERR_IO);
- }
- }
-
- ret = sos_end(grp, 1);
- if(ret != 0)
- {
- return(TRITON_ERR_IO);
- }
-
- return(TRITON_SUCCESS);
-}
-
-
-static __blocking triton_ret_t triton_rpc_rsos_write(hg_handle_t handle)
-{
- triton_rpc_rsos_write_out_t out;
- triton_rpc_rsos_write_in_t in;
- int ret = 0;
- na_addr_t next_addr;
- na_addr_t* addr_array;
- int my_position;
- na_addr_t src_addr;
- struct hg_info *info = NULL;
- int test_rep_factor;
-
- triton_debug(triton_dbg_rosd, "Called triton_rpc_rsos_write()\n");
-
- info = HG_Get_info(handle);
- src_addr = info->addr;
-
- triton_mercury_get_input(handle, &in, &out);
-
- triton_debug(triton_dbg_rosd, "rsos_write() with incoming replication factor of %d and incoming expected position of %d\n", in.replication_factor, in.expected_position);
-
- /* downstream replicas must have replication factor already defined for
- * them.
- */
- if(in.expected_position != 0 && in.replication_factor == 0)
- {
- out.tret = TRITON_ERR_INVAL;
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
-
- /* check if this is the correct server for the expected position of the
- * request chain
- */
- if(in.expected_position == 0)
- {
- /* this request is intended for the master server */
-
- /* replication factor may not be known yet; check our position
- * with an assumed replication factor just to check that we are
- * first in line.
- */
- test_rep_factor = 1;
- }
- else
- {
- test_rep_factor = in.replication_factor;
- }
-
- addr_array = malloc(test_rep_factor*sizeof(*addr_array));
- if(!addr_array)
- {
- out.tret = TRITON_ERR_NOMEM;
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
-
- out.tret = asg_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
- if(triton_is_error(out.tret))
- {
- triton_mercury_respond(handle, &out);
- free(addr_array);
- return(TRITON_SUCCESS);
- }
-
- if(my_position != in.expected_position)
- {
- out.tret = TRITON_ERR_WRONG_SERVER;
- triton_mercury_respond(handle, &out);
- free(addr_array);
- return(TRITON_SUCCESS);
- }
-
- /* now check that the replication factor is valid and store it on disk
- * if needed
- * NOTE: wrapped in a loop to handle sos txn retries
- */
- /* TODO: fix error codes; need to differentiate sos canceled (which
- * means we should retry) from aesop canceled (which means the operation
- * has been explicitly canceled by another thread, likely due to error
- * cleanup)
- */
- out.tret = TRITON_ERR_CANCELED;
- while(triton_error_equal(out.tret, TRITON_ERR_CANCELED))
- {
- out.tret = resolve_replication_factor(&in);
- }
-
- if(in.replication_factor > test_rep_factor)
- {
- /* earlier replication factor assumption was wrong; look up mapping
- * again
- */
- free(addr_array);
- addr_array = malloc(test_rep_factor*sizeof(*addr_array));
- if(!addr_array)
- {
- out.tret = TRITON_ERR_NOMEM;
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
-
- out.tret = asg_oid_to_addrs(in.object, test_rep_factor, &my_position, addr_array);
- if(triton_is_error(out.tret))
- {
- triton_mercury_respond(handle, &out);
- free(addr_array);
- return(TRITON_SUCCESS);
- }
- }
-
- /* TODO: check flags to make sure this isn't an explicit conditional */
-
- /* TODO: revise txn_nr_cache to query correct version number out of
- * SOS; for now we just hard code version number to 0.
- */
-#if 0
- if(in.expected_position == 0)
- {
- /* figure out what transaction number to use */
- out.tret = txn_nr_cache_get(&entry_p, in.object, &in.update_id_condition, in.flags);
- if(triton_is_error(out.tret))
- {
- triton_error_msg("txn_nr_cache_get() failure.\n");
- triton_mercury_respond(handle, &out);
- return(TRITON_SUCCESS);
- }
- }
-#else
- in.update_id_condition = 0;
-#endif
-
- if(my_position < (in.replication_factor-1))
- {
- next_addr = addr_array[my_position+1];
- }
-
- triton_debug(triton_dbg_rosd, "rsos_write() triggered, running pipeline.\n");
-
- out.tret = rsos_write_run_pipeline(handle, src_addr, next_addr, my_position,
- &in);
-
-#if 0
- if(entry_p)
- txn_nr_cache_put(entry_p);
-#endif
-
- triton_mercury_respond(handle, &out);
- free(addr_array);
-
- /* clean up */
- HG_Free_output(handle, &out);
- HG_Destroy(handle);
-
- return(TRITON_SUCCESS);
-}
-TRITON_DEFINE_RPC_HANDLER(triton_rpc_rsos_write)
-
-void triton_rpc_rsos_write_register(void)
-{
- hg_class_t* hg_class = NULL;
-
- hg_class = triton_mercury_engine_get_class();
-
- rpc_rsos_write_id =
- MERCURY_REGISTER(hg_class, "triton_rpc_rsos_write",
- triton_rpc_rsos_write_in_t,
- triton_rpc_rsos_write_out_t,
- triton_rpc_rsos_write_handler);
-
- return;
-}
-
-static __blocking triton_ret_t __remote_triton_rpc_rsos_write(
- na_addr_t addr,
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- uint64_t recordlen,
- void* data,
- uint32_t flags,
- uint64_t update_id_condition,
- uint64_t *new_update_id,
- uint32_t expected_position,
- uint32_t replication_factor)
-{
- triton_rpc_rsos_write_out_t out;
- triton_rpc_rsos_write_in_t in;
- int ret;
- triton_ret_t tret;
- hg_handle_t handle = HG_HANDLE_NULL;
- size_t bulk_size = recordcount*recordlen;
-
- in.object = object;
- in.fork = fork;
- in.start_record = start_record;
- in.recordcount = recordcount;
- in.recordlen = recordlen;
- in.flags = flags;
- in.update_id_condition = update_id_condition;
- in.replication_factor = replication_factor;
- in.expected_position = expected_position;
- in.bulk_handle = HG_BULK_NULL;
-
- triton_mercury_run_rpc_with_bulk(addr, rpc_rsos_write_id, handle,
- &in, &out, in.bulk_handle, data, bulk_size, HG_BULK_READ_ONLY);
-
- tret = triton_error_dup(out.tret);
-
- HG_Free_output(handle, &out);
- HG_Destroy(handle);
-
- return(tret);
-}
-
-static __blocking triton_ret_t rsos_write_do_work(
- na_addr_t next_addr,
- char* buffer,
- int my_position,
- uint64_t start_record,
- uint64_t recordcount,
- triton_rpc_rsos_write_in_t* in)
-{
- triton_ret_t local_tret;
- triton_ret_t remote_tret = TRITON_SUCCESS;
- triton_ret_t tret;
- uint64_t new_update_id;
-
- /* right now only chained replication is supported */
- assert(!(in->flags & ROSD_FLAG_FANOUT));
- in->flags |= ROSD_FLAG_CHAIN;
-
- pwait
- {
- pbranch
- {
- /* forward on to peers if necessary */
- if(my_position < in->replication_factor-1)
- {
- triton_debug(triton_dbg_rosd, "ROSD forwarding write of oid %llu to %d'th server.\n", llu(in->object), my_position+1);
-
- remote_tret = __remote_triton_rpc_rsos_write(
- next_addr, in->container, in->object, in->fork,
- start_record, recordcount, in->recordlen, buffer,
- in->flags, in->update_id_condition, &new_update_id,
- my_position+1, in->replication_factor);
- }
- }
- pbranch
- {
- triton_debug(triton_dbg_rosd, "ROSD local write of oid %llu on %d'th server, update_id %llu.\n", llu(in->object), my_position, llu(in->update_id_condition));
- /* perform local operation */
- /* TODO: fix error codes; need to differentiate sos canceled (which
- * means we should retry) from aesop canceled (which means the operation
- * has been explicitly canceled by another thread, likely due to error
- * cleanup)
- */
- local_tret = TRITON_ERR_CANCELED;
- while(local_tret == TRITON_ERR_CANCELED)
- {
- local_tret = rosd_write_local_storage(
- in->container,
- in->object,
- in->fork,
- start_record,
- recordcount,
- in->recordlen,
- buffer,
- 0,
- in->update_id_condition,
- &new_update_id);
- }
- }
- }
-
- if(my_position < in->replication_factor-1)
- tret = interpret_errors(local_tret, remote_tret, my_position,
- is_usage_error_write, !in->expected_position);
- else
- tret = interpret_error(local_tret, my_position, is_usage_error_write,
- !in->expected_position);
-
- return(tret);
-}
-
-/**
- * Checks the triton_ret_t to determine if the error code represents a
- * usage error rather than an a storage fault. Returns 1 if usage
- * error code, 0 if storage fault.
- */
-static int is_usage_error_write(triton_ret_t tret)
-{
- /* these are the scenarios that a write could fail because of a
- * usage (ie, semantic) error rather than because of a system fault.
- */
- if(triton_error_equal(tret, TRITON_ERR_NO_SERVERS) ||
- triton_error_equal(tret, TRITON_ERR_NOENT) ||
- triton_error_equal(tret, TRITON_ERR_ACCES))
- {
- /* if there aren't enough servers to satisfy the replication
- * request, or the object doesn't exist, or if
- * permission was denied.
- */
- return(1);
- }
-
- return(0);
-}
-
-static __blocking triton_ret_t rosd_write_local_storage(
- uint64_t container,
- uint64_t object,
- uint64_t fork,
- uint64_t start_record,
- uint64_t recordcount,
- uint64_t recordlen,
- char* buffer,
- uint32_t flags,
- uint64_t update_id_condition,
- uint64_t *new_update_id)
-{
- struct sos_grp *grp;
- struct sos_oid soid;
- sos_eid_t soid_eids[3];
- sos_size_t nbytes;
- sos_update_t update_info;
- int ret;
-
- /* TODO: handle canceled error code (or whatever sos will report to
- * indicate that a txn failed and should be retried)
- */
- ret = sos_begin(&grp, NULL, 0, g_sos_ctx);
- if(ret != 0)
- {
- return(TRITON_ERR_IO);
- }
-
- soid.nids = 3;
- soid.ids = soid_eids;
- soid_eids[0] = container;
- soid_eids[1] = object;
- soid_eids[2] = fork;
-
- /* TODO: the update id arguments probably aren't right here... */
- ret = sos_write(&soid, start_record, recordcount, recordlen, 0, 0, update_id_condition, buffer, &nbytes, grp);
- if(ret != 0 || nbytes != recordcount*recordlen)
- {
- triton_error_msg("sos_write() failure, return code %d\n", ret);
- sos_end(grp, 0);
- return(TRITON_ERR_IO);
- }
-
- ret = sos_end(grp, 1);
- if(ret != 0)
- {
- return(TRITON_ERR_IO);
- }
-
- return(TRITON_SUCCESS);
-}
-
-
-/*
- * Local Variables:
- * c-basic-offset: 4
- * End:
- *
- * vim: ft=c ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/tests/Makefile.subdir b/code/tests/Makefile.subdir
index e5e594e..29e19ea 100644
--- a/code/tests/Makefile.subdir
+++ b/code/tests/Makefile.subdir
@@ -12,8 +12,7 @@ check_PROGRAMS += \
tests/common/test-debug \
tests/placement/test-placement \
tests/system-state/test-system-state \
- tests/asg/test-asg-simple \
- tests/asg/test-asg-simple-sos
+ tests/asg/test-asg-simple
#TODO: REPLACEME
#tests/transactional-osd/tosd1
@@ -46,8 +45,6 @@ TESTS += \
#tests/transactional-osd/tosd-bench-create.sh
#tests/transactional-osd/bdb-snapshot-write.sh
-#tests/asg/test-asg-simple-sos.sh
-
AE_SRC += tests/placement/test-placement.ae \
tests/replicated-osd/buffer-mgmt-test.ae \
tests/system-state/test-system-state.ae
@@ -59,7 +56,6 @@ AE_SRC += tests/placement/test-placement.ae \
tests_common_test_triton_ret_t_SOURCES = tests/common/test-triton-ret-t.c
tests_common_test_debug_SOURCES = tests/common/test-debug.c
tests_asg_test_asg_simple_SOURCES = tests/asg/test-asg-simple.c
-tests_asg_test_asg_simple_sos_SOURCES = tests/asg/test-asg-simple-sos.c
#tests_transactional_osd_bdb_snapshot_write_SOURCES = tests/transactional-osd/bdb-snapshot-write.c
EXTRA_DIST += \
@@ -74,7 +70,6 @@ EXTRA_DIST += \
tests/common/test-debug.sh \
tests/triton-ls-object.sh \
tests/asg/test-asg-simple.sh \
- tests/asg/test-asg-simple-sos.sh \
tests/triton-touch.sh \
tests/triton-show-config.sh \
tests/triton-cp.sh \
diff --git a/code/tests/asg/test-asg-simple-sos.c b/code/tests/asg/test-asg-simple-sos.c
deleted file mode 100644
index 55c1236..0000000
--- a/code/tests/asg/test-asg-simple-sos.c
+++ /dev/null
@@ -1,201 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include "include/asg.h"
-
-int main(int argc, char **argv)
-{
- int ret;
- asg_instance_t ait;
- asg_update_id_t out_ver;
- asg_container_id_t cid;
- asg_object_id_t oid;
- asg_fork_id_t fid;
- asg_record_id_t rid;
- asg_size_t out_size;
- char *buffer = NULL;
- int buffer_sz = -1;
- asg_size_t count;
- int i;
- char fill = '\0';
- asg_fork_info_t fork_buf;
- asg_fork_id_t next_fid;
-
- if(argc != 4)
- {
- fprintf(stderr, "Usage: test-asg-simple <server address> <oid> <size>\n");
- fprintf(stderr, " example: ./test-asg-simple tcp://localhost:3344 555 1024\n");
- return(-1);
- }
-
-#if __WORDSIZE == 64
- ret = sscanf(argv[2], "%lu", &oid);
-#else
- ret = sscanf(argv[2], "%llu", &oid);
-#endif
- if(ret != 1)
- {
- fprintf(stderr, "Usage: test-asg-simple <server address> <oid> <size>\n");
- fprintf(stderr, " example: ./test-asg-simple tcp://localhost:3344 555 1024\n");
- return(-1);
- }
-
- ret = sscanf(argv[3], "%d", &buffer_sz);
- if(ret != 1)
- {
- fprintf(stderr, "Usage: test-asg-simple <server address> <oid> <size>\n");
- fprintf(stderr, " example: ./test-asg-simple tcp://localhost:3344 555 1024\n");
- return(-1);
- }
-
- cid = 1;
- fid = 1;
- rid = 0;
-
- /* allocate memory buffer and fill with reproducable pattern */
- buffer = malloc(buffer_sz);
- if(!buffer)
- {
- perror("malloc");
- return(-1);
- }
- for(i=0; i<buffer_sz; i++)
- {
- buffer[i] = fill;
- fill++;
- }
-
- ret = asg_initialize(&ait, argv[1]);
- if(ret != ASG_SUCCESS)
- {
- fprintf(stderr, "Error: asg_initialize(..., \"%s\")\n", argv[1]);
- return(-1);
- }
-
- /* write data */
- ret = asg_write_sos(
- ait,
- ASG_LOCATION_AUTO,
- cid, /* container */
- oid, /* obj */
- fid, /* fork */
- rid, /* start rec */
- buffer_sz, /* rec count */
- 1, /* rec len */
- ASG_AUTO_UPDATE_ID, /* flags */
- 0, /* update id */
- &out_ver, /* assigned version */
- buffer, /* data */
- &out_size); /* resulting size */
- if(ret != ASG_SUCCESS)
- {
- fprintf(stderr, "Error: asg_write()\n");
- return(-1);
- }
-
-#if 0
- /* reset buffer */
- memset(buffer, 0, buffer_sz);
-
- /* read data back out */
- ret = asg_read_sos(
- ait,
- ASG_LOCATION_AUTO,
- cid, /* container */
- oid, /* obj */
- fid, /* fork */
- rid, /* start rec */
- buffer_sz, /* rec count */
- ASG_COND_NONE, /* flags */
- 0, /* update id */
- buffer,
- buffer_sz,
- &out_size, /* resulting size */
- NULL, /* record info */
- NULL, /* number of record info bufs */
- &out_ver); /* assigned version */
- if(ret != ASG_SUCCESS)
- {
- fprintf(stderr, "Error: asg_read()\n");
- return(-1);
- }
-
- /* confirm buffer contents */
- fill = '\0';
- for(i=0; i<buffer_sz; i++)
- {
- if(buffer[i] != fill)
- {
- fprintf(stderr, "Error: buffer validation failure starting at offset %d\n", i);
- return(-1);
- }
- fill++;
- }
-
- free(buffer);
-
- ret = asg_probe_object(ait,
- ASG_LOCATION_AUTO,
- cid,
- oid,
- fid,
- &fork_buf,
- 1,
- &count,
- &next_fid);
- assert(ret == ASG_SUCCESS);
- assert(fork_buf.fork_id == fid);
- assert(fork_buf.seq_len == 1);
- assert(fork_buf.record_count == buffer_sz);
-
- ret = asg_reset (ait,
- ASG_LOCATION_AUTO,
- cid,
- oid,
- ASG_FORK_NULL,
- ASG_RECORD_NULL,
- 0, // record count
- 0, // record len
- 0, // flags
- ASG_COND_NONE, // condition
- &count);
- if (ret != ASG_SUCCESS)
- {
- fprintf(stderr, "error: asg_reset : %d - %ld\n", ret, count);
- }
-
- ret = asg_probe_object(ait,
- ASG_LOCATION_AUTO,
- cid,
- oid,
- fid,
- &fork_buf,
- 1,
- &count,
- &next_fid);
- assert(count == 0);
-
-#endif
-
- ret = asg_finalize(ait);
- if(ret != ASG_SUCCESS)
- {
- fprintf(stderr, "Error: asg_finalize()\n");
- return(-1);
- }
-
- return(0);
-}
-
-/*
- * Local variables:
- * c-indent-level: 4
- * c-basic-offset: 4
- * End:
- *
- * vim: ft=c ts=8 sts=4 sw=4 expandtab
- */
diff --git a/code/tests/asg/test-asg-simple-sos.sh b/code/tests/asg/test-asg-simple-sos.sh
deleted file mode 100755
index 43214f5..0000000
--- a/code/tests/asg/test-asg-simple-sos.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash -x
-
-if [ -z $srcdir ]; then
- echo srcdir variable not set.
- exit 1
-fi
-source $srcdir/tests/test-util.sh
-
-# start 1 server with 5 second wait, 60s timeout, rep factor 1
-test_start_servers 1 5 60 1
-
-# actual test case
-#####################
-run_to 60 tests/asg/test-asg-simple-sos $svr1 777 1024
-if [ $? -ne 0 ]; then
- run_to 60 src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null
- wait
- exit 1
-fi
-#####################
-
-# tear down
-run_to 60 src/admin-tools/triton-shutdown-all-servers $svr1 &> /dev/null
-
-wait
-exit 0
hooks/post-receive
--
1
0
branch, trac-323-sos, updated. f426c0145b6b4f0ecf0e1880f0b9ce2caf560269
by noreply@mcs.anl.gov 22 Dec '14
by noreply@mcs.anl.gov 22 Dec '14
22 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via f426c0145b6b4f0ecf0e1880f0b9ce2caf560269 (commit)
from 07c0a2a6212329a063166742cd3f2a3048733c2c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f426c0145b6b4f0ecf0e1880f0b9ce2caf560269
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Mon Dec 22 12:51:23 2014 -0600
rm some misc. tosd code (configuration, debug)
-----------------------------------------------------------------------
Summary of changes:
code/src/common/triton-debug.spec | 1 -
code/src/zeroconf/zeroconf.c | 49 -------------------------------------
code/tests/test-util.sh | 5 +---
3 files changed, 1 insertions(+), 54 deletions(-)
Diff of changes:
diff --git a/code/src/common/triton-debug.spec b/code/src/common/triton-debug.spec
index 5a40234..10d967c 100644
--- a/code/src/common/triton-debug.spec
+++ b/code/src/common/triton-debug.spec
@@ -23,7 +23,6 @@
1 "info" "Informational messages"
0 "example" "Example debugging mask for testing purposes"
0 "example.subexample" "Example debugging mask with hierarchy for testing purposes"
-0 "tosd" "Transactional OSD (server-side local storage component)"
0 "rosd" "Replicated OSD (server-side replicated storage component)"
0 "rosd.txncache" "Replicated OSD: transaction number cache"
0 "signal" "Signal handling resource"
diff --git a/code/src/zeroconf/zeroconf.c b/code/src/zeroconf/zeroconf.c
index c81d473..339aa61 100644
--- a/code/src/zeroconf/zeroconf.c
+++ b/code/src/zeroconf/zeroconf.c
@@ -40,55 +40,6 @@ struct zeroconf_entry zeroconf_array[] =
"Debug mask to enable debugging of various triton components",
NULL,
},
- /* local storage options */
- {
- CFG_STR("triton_tosd_discard_data", "no", CFGF_NONE),
- "Should the TOSD discard data payloads? yes|no",
- NULL,
- },
- {
- CFG_STR("triton_tosd_db_path", 0, CFGF_NONE),
- "Directory that will contain Berkeley DB files used by the TOSD",
- NULL,
- },
- {
- CFG_STR("triton_tosd_data_path", 0, CFGF_NONE),
- "Directory that will contain raw data stored by the TOSD",
- NULL,
- },
- {
- CFG_STR("triton_tosd_db_coalescing_highwater", "8", CFGF_NONE),
- "Highwater mark for Berkeley DB coalescing",
- NULL,
- },
- {
- CFG_STR("triton_tosd_data_coalescing_highwater", "8", CFGF_NONE),
- "Highwater mark for data (fsync) coalescing",
- NULL,
- },
- {
- CFG_STR("triton_tosd_alignment", "4096", CFGF_NONE),
- "TOSD data on-disk data alignment (directio mode requires block alignment)",
- NULL,
- },
-#ifdef HAVE_ODIRECT
- {
- CFG_STR("triton_tosd_flags", "DATA_ODIRECT,DATA_SYNC", CFGF_NONE),
- "TOSD initialization flags (DATA_ODIRECT for directio, DATA_SYNC for fsync)",
- NULL,
- },
-#else
- {
- CFG_STR("triton_tosd_flags", "DATA_SYNC", CFGF_NONE),
- "TOSD initialization flags (DATA_SYNC for fsync)",
- NULL,
- },
-#endif
- {
- CFG_STR("triton_tosd_insert_errors_at_rate", "0", CFGF_NONE),
- "Rate at which to inject storage errors, from 0.0 to 100.0",
- NULL,
- },
/* sos configuration parameters (TODO: grow) */
{
CFG_STR("triton_sos_base_path", 0, CFGF_NONE),
diff --git a/code/tests/test-util.sh b/code/tests/test-util.sh
index 1a6b172..40ec7e9 100644
--- a/code/tests/test-util.sh
+++ b/code/tests/test-util.sh
@@ -40,11 +40,8 @@ function test_gen_conf ()
done
echo "}" >> ${TMPBASE}/triton-$pid.conf
echo "triton_debug_file = ${TMPBASE}/triton-server-%TRITON_SERVER_NAME%.log" >> ${TMPBASE}/triton-$pid.conf
- echo "triton_tosd_db_path = ${TMPBASE}/triton-server-%TRITON_SERVER_NAME%-meta" >> ${TMPBASE}/triton-$pid.conf
- echo "triton_tosd_data_path = ${TMPBASE}/triton-server-%TRITON_SERVER_NAME%-data" >> ${TMPBASE}/triton-$pid.conf
echo "triton_sos_base_path = ${TMPBASE}/triton-server-%TRITON_SERVER_NAME%-sos" >> ${TMPBASE}/triton-$pid.conf
echo "triton_debug_masks = \"all\"" >> ${TMPBASE}/triton-$pid.conf
- echo "triton_tosd_flags = \"DATA_SYNC\"" >> ${TMPBASE}/triton-$pid.conf
if [[ $repfactor -gt 0 ]] ; then
echo "triton_rosd_default_replication_factor = $repfactor" \
>> ${TMPBASE}/triton-$pid.conf
@@ -66,7 +63,7 @@ function test_start_servers ()
# start daemons
for i in `seq $startport $endport`
do
- timeout --signal=9 ${maxtime} src/server/triton-server --conf ${TMPBASE}/triton-$pid.conf --listenaddr tcp://localhost:$i &> /dev/null &
+ timeout --signal=9 ${maxtime} src/server/triton-server --conf ${TMPBASE}/triton-$pid.conf --listenaddr tcp://localhost:$i &> ${TMPBASE}/triton-$pid.out &
if [ $? -ne 0 ]; then
exit 1
fi
hooks/post-receive
--
1
0
branch, trac-323-sos, updated. 07c0a2a6212329a063166742cd3f2a3048733c2c
by noreply@mcs.anl.gov 19 Dec '14
by noreply@mcs.anl.gov 19 Dec '14
19 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via 07c0a2a6212329a063166742cd3f2a3048733c2c (commit)
via 91f74278e82428d4e90d8d629f9a5201581575b5 (commit)
via b950f26de8300ee35482d2a9672e8282ba1b2fd9 (commit)
via 19a9fc9aa9404a198f824edca18a3065379ff0e4 (commit)
via 1353c2f37a32d5977a8946572b7608961ba5f81e (commit)
via 26a09d342cdff6fdf69e6b6f0d479e9992b66ba9 (commit)
via 853157e8b6b933dea13f702a9662c1b0f9858fea (commit)
via b23c41bc32de0c6dc323106431950066d2a366f8 (commit)
from 8ab1b209b03fc6821e9a5f01534231f366b02b2c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 07c0a2a6212329a063166742cd3f2a3048733c2c
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 16:31:34 2014 -0600
conversion of rosd probe object to use container/oid
uint128 has been eliminated from rosd. It's still used in some places, esp.
with user input (inputs and configs still use ipv6 [128-bit] format). We'll
need to decide how to represent these (maybe just have the upper 64 bits
explicitly be the container?).
commit 91f74278e82428d4e90d8d629f9a5201581575b5
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 15:53:20 2014 -0600
conversion of rosd probe fork to use container/oid
commit b950f26de8300ee35482d2a9672e8282ba1b2fd9
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 15:45:12 2014 -0600
conversion of rosd read to use container/oid
commit 19a9fc9aa9404a198f824edca18a3065379ff0e4
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 15:38:30 2014 -0600
conversion of rosd range to use container/oid
commit 1353c2f37a32d5977a8946572b7608961ba5f81e
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 15:11:57 2014 -0600
conversion of rosd write to container/oid
commit 26a09d342cdff6fdf69e6b6f0d479e9992b66ba9
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 14:40:29 2014 -0600
conversion of rosd reset to container/oid
commit 853157e8b6b933dea13f702a9662c1b0f9858fea
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 14:24:19 2014 -0600
conversion of rosd remove to container/oid
commit b23c41bc32de0c6dc323106431950066d2a366f8
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 13:33:30 2014 -0600
conversion of rosd create to container/oid
-----------------------------------------------------------------------
Summary of changes:
code/src/admin-tools/triton-cp.ae | 13 +++-
code/src/admin-tools/triton-ls.ae | 49 +++++++++-------
code/src/admin-tools/triton-mkdat.ae | 15 +++--
code/src/admin-tools/triton-rm.ae | 2 +-
code/src/admin-tools/triton-touch.ae | 10 ++-
code/src/asg/asg-internal.ae | 45 +++++----------
code/src/replicated-osd/rosd-create.ae | 76 ++++++++++++++----------
code/src/replicated-osd/rosd-internal.hae | 18 +++++-
code/src/replicated-osd/rosd-probe-fork.ae | 9 ++-
code/src/replicated-osd/rosd-probe-object.ae | 9 ++-
code/src/replicated-osd/rosd-range.ae | 33 ++++++-----
code/src/replicated-osd/rosd-read.ae | 17 ++++--
code/src/replicated-osd/rosd-remove.ae | 71 +++++++++++++----------
code/src/replicated-osd/rosd-reset.ae | 39 +++++++++----
code/src/replicated-osd/rosd-txn-nr-cache.ae | 34 ++++-------
code/src/replicated-osd/rosd-txn-nr-cache.hae | 6 +-
code/src/replicated-osd/rosd-util.ae | 20 ++++---
code/src/replicated-osd/rosd-write.ae | 66 +++++++++++----------
code/src/replicated-osd/rosd.ae | 70 +++++++++++++++++++++++
code/src/replicated-osd/rosd.hae | 31 ++++++----
20 files changed, 389 insertions(+), 244 deletions(-)
Diff of changes:
diff --git a/code/src/admin-tools/triton-cp.ae b/code/src/admin-tools/triton-cp.ae
index 16c486b..e6a3106 100644
--- a/code/src/admin-tools/triton-cp.ae
+++ b/code/src/admin-tools/triton-cp.ae
@@ -37,7 +37,8 @@ struct obj_ref
}posix;
struct
{
- uint128_t oid;
+ uint128_t oid_l;
+ uint64_t oid;
int64_t offset;
}triton;
}u;
@@ -197,13 +198,14 @@ static struct obj_ref* tc_resolve(char* name)
* functions to convert from string to uint128_t because I know that
* node_t and uint128_t are the same thing...
*/
- ref->u.triton.oid = triton_node_from_string(name);
- if(triton_node_equal(ref->u.triton.oid, triton_node_null))
+ ref->u.triton.oid_l = triton_node_from_string(name);
+ if(triton_node_equal(ref->u.triton.oid_l, triton_node_null))
{
fprintf(stderr, "Error: %s is an invalid oid.\n", name);
free(ref);
return(NULL);
}
+ ref->u.triton.oid = ref->u.triton.oid_l.l;
ref->u.triton.offset = 0;
}
@@ -244,7 +246,8 @@ static __blocking int tc_open(struct obj_ref* ref, int create_if_needed)
if(create_if_needed)
{
/* TODO: make replication factor configurable */
- tret = remote_triton_rpc_rosd_create(ref->u.triton.oid, replication_factor, 0);
+ tret = remote_triton_rpc_rosd_create(0, ref->u.triton.oid,
+ replication_factor, 0);
if(triton_error_equal(tret, TRITON_ERR_EXIST))
{
fprintf(stderr, "Error: unimplemented; need to truncate triton object.\n");
@@ -292,6 +295,7 @@ static __blocking int tc_read(struct obj_ref* ref, char* buffer, int size)
else if(ref->type == TYPE_TRITON)
{
tret = remote_triton_rpc_rosd_read(
+ 0,
ref->u.triton.oid,
0,
buffer,
@@ -339,6 +343,7 @@ static __blocking int tc_write(struct obj_ref* ref, const char* buffer, int size
else if(ref->type == TYPE_TRITON)
{
tret = remote_triton_rpc_rosd_write(
+ 0,
ref->u.triton.oid,
0,
buffer,
diff --git a/code/src/admin-tools/triton-ls.ae b/code/src/admin-tools/triton-ls.ae
index dbb027f..d2b4bc9 100644
--- a/code/src/admin-tools/triton-ls.ae
+++ b/code/src/admin-tools/triton-ls.ae
@@ -34,16 +34,17 @@ __blocking int list_objects (char *svr_string)
char* node_string;
triton_node_t *node_array;
int node_array_count;
- uint128_t *oid_array;
+ uint64_t *oid_array;
uint32_t oid_array_count;
+ uint128_t oid_tmp;
na_addr_t addr;
- uint128_t next_position;
- uint128_t lower;
- uint128_t upper;
+ uint64_t next_position;
+ uint64_t lower;
+ uint64_t upper;
char *oid_str;
int i,j;
- oid_array = (uint128_t*)malloc(BATCH_SIZE*sizeof(*oid_array));
+ oid_array = malloc(BATCH_SIZE*sizeof(*oid_array));
if(!oid_array)
{
perror("malloc");
@@ -83,19 +84,19 @@ __blocking int list_objects (char *svr_string)
free(node_string);
free(addr_string);
- triton_uint128_setzero(next_position);
- triton_uint128_setzero(lower);
- triton_uint128_setmax(upper);
+ next_position = 0;
+ lower = 0;
+ upper = UINT64_MAX;
tret = TRITON_SUCCESS;
- while(triton_cmp_uint128(next_position, upper) != 0
- && !triton_is_error(tret))
+ while(next_position != upper && !triton_is_error(tret))
{
tret = remote_triton_rpc_rosd_range(
- addr, lower, upper, BATCH_SIZE, oid_array, &oid_array_count,
+ addr, 0, lower, upper, BATCH_SIZE, oid_array, &oid_array_count,
&next_position);
for(j=0; !triton_is_error(tret) && j<oid_array_count; j++)
{
- oid_str = triton_uint128_to_string(oid_array[j]);
+ oid_tmp = triton_uint128_from_uint64(oid_array[j]);
+ oid_str = triton_uint128_to_string(oid_tmp);
printf("\t%s\n", oid_str);
if (oid_str) free(oid_str);
}
@@ -123,7 +124,8 @@ __blocking int list_objects (char *svr_string)
__blocking int list_forks (char *oid_string)
{
triton_ret_t tret;
- uint128_t oid;
+ uint128_t oid_l;
+ uint64_t oid;
uint64_t fid;
uint64_t next;
uint64_t count;
@@ -137,7 +139,8 @@ __blocking int list_forks (char *oid_string)
assert(ffork && flen && fcount);
- oid = triton_uint128_from_string(oid_string);
+ oid_l = triton_uint128_from_string(oid_string);
+ oid = oid_l.l;
printf("forks for oid(%s)\n", oid_string);
@@ -145,7 +148,7 @@ __blocking int list_forks (char *oid_string)
{
fid = next;
tret = remote_triton_rpc_rosd_probe_object(
- oid, fid, BATCH_SIZE, &count, &next,
+ 0, oid, fid, BATCH_SIZE, &count, &next,
ffork, flen, fcount);
if (triton_is_error(tret))
{
@@ -180,7 +183,8 @@ __blocking int list_records (char *oid_string,
char *fid_string)
{
triton_ret_t tret;
- uint128_t oid;
+ uint128_t oid_l;
+ uint64_t oid;
uint128_t t;
uint64_t fid;
uint64_t count;
@@ -197,15 +201,16 @@ __blocking int list_records (char *oid_string,
assert(rrecord && rversion && rlen && rcount);
- oid = triton_uint128_from_string(oid_string);
+ oid_l = triton_uint128_from_string(oid_string);
t = triton_uint128_from_string(fid_string);
+ oid = oid_l.l;
fid = t.l;
printf("records for oid(%s) fid(%s)\n", oid_string, fid_string);
for (next = 0; next != UINT64_MAX; )
{
tret = remote_triton_rpc_rosd_probe_fork (
- oid, fid, next,
+ 0, oid, fid, next,
BATCH_SIZE, &count, &next,
rrecord, rversion, rlen, rcount);
if (triton_is_error(tret))
@@ -239,7 +244,8 @@ __blocking int list_record (char *oid_string,
char *rid_string)
{
triton_ret_t tret;
- uint128_t oid;
+ uint128_t oid_l;
+ uint64_t oid;
uint128_t t;
uint64_t fid;
uint64_t rid;
@@ -250,7 +256,8 @@ __blocking int list_record (char *oid_string,
uint64_t rlen;
uint64_t rcount;
- oid = triton_uint128_from_string(oid_string);
+ oid_l = triton_uint128_from_string(oid_string);
+ oid = oid_l.l;
t = triton_uint128_from_string(fid_string);
fid = t.l;
t = triton_uint128_from_string(rid_string);
@@ -260,7 +267,7 @@ __blocking int list_record (char *oid_string,
oid_string, fid_string, rid_string);
tret = remote_triton_rpc_rosd_probe_fork (
- oid, fid, rid,
+ 0, oid, fid, rid,
1, &count, &next,
&rrecord, &rversion, &rlen, &rcount);
if (triton_is_error(tret))
diff --git a/code/src/admin-tools/triton-mkdat.ae b/code/src/admin-tools/triton-mkdat.ae
index 5687d49..55f7d1e 100644
--- a/code/src/admin-tools/triton-mkdat.ae
+++ b/code/src/admin-tools/triton-mkdat.ae
@@ -179,20 +179,22 @@ __blocking int aesop_main(int argc, char **argv){
/* perform the writes */
int64_t obj, fork, write_nr;
- uint128_t oid;
+ uint64_t oid;
+ uint128_t oid_l;
for (obj = 1; obj <= opts.num_objects; obj++){
time_per_write = (opts.time_write >= 3 && obj == opts.num_objects);
assert(!(time_per_object && time_per_write));
if (opts.dist == SEQ){
- oid.u = 0;
- oid.l = (uint64_t) obj;
+ oid = (uint64_t) obj;
+ oid_l = triton_uint128_from_uint64(oid);
}
else {
- assert(0);
+ assert(0);
}
- tret = remote_triton_rpc_rosd_create(oid, opts.replication_factor, 0);
+ tret = remote_triton_rpc_rosd_create(0, oid, opts.replication_factor,
+ 0);
if (triton_error_equal(tret, TRITON_ERR_EXIST)){
- char * str = triton_uint128_to_string(oid);
+ char * str = triton_uint128_to_string(oid_l);
fprintf(stderr, "Object %s exists, need to delete manually for "
"the time being\n", str);
triton_error_destroy(tret);
@@ -224,6 +226,7 @@ __blocking int aesop_main(int argc, char **argv){
per_write_time = tsToS(ts);
}
tret = remote_triton_rpc_rosd_write(
+ 0,
oid,
fork,
(char*) buffer, /* why a char*? */
diff --git a/code/src/admin-tools/triton-rm.ae b/code/src/admin-tools/triton-rm.ae
index 3bed78a..8ec6b95 100644
--- a/code/src/admin-tools/triton-rm.ae
+++ b/code/src/admin-tools/triton-rm.ae
@@ -170,7 +170,7 @@ __blocking int aesop_main(int argc, char **argv)
printf("removing: %s\n", oid_str);
if (oid_str) free(oid_str);
}
- tret = remote_triton_rpc_rosd_remove (oids[i], ROSD_FLAG_CHAIN);
+ tret = remote_triton_rpc_rosd_remove (0, oids[i].l, ROSD_FLAG_CHAIN);
if (triton_is_error(tret))
{
triton_error_print(tret, "remote_triton_rpc_rosd_remove");
diff --git a/code/src/admin-tools/triton-touch.ae b/code/src/admin-tools/triton-touch.ae
index b2a0193..8f82713 100644
--- a/code/src/admin-tools/triton-touch.ae
+++ b/code/src/admin-tools/triton-touch.ae
@@ -17,7 +17,8 @@ __blocking int aesop_main(int argc, char **argv)
{
triton_ret_t tret;
char* svr_string;
- uint128_t oid;
+ uint128_t oid_l;
+ uint64_t oid;
unsigned int replication_factor;
int ret;
@@ -34,12 +35,13 @@ __blocking int aesop_main(int argc, char **argv)
* functions to convert from string to uint128_t because I know that
* node_t and uint128_t are the same thing...
*/
- oid = triton_node_from_string(argv[2]);
- if(triton_node_equal(oid, triton_node_null))
+ oid_l = triton_node_from_string(argv[2]);
+ if(triton_node_equal(oid_l, triton_node_null))
{
fprintf(stderr, "Error: %s is an invalid oid.\n", argv[2]);
return(-1);
}
+ oid = oid_l.l;
ret = sscanf(argv[3], "%u", &replication_factor);
if(ret != 1)
@@ -79,7 +81,7 @@ __blocking int aesop_main(int argc, char **argv)
}
/* create object */
- tret = remote_triton_rpc_rosd_create(oid, replication_factor, 0);
+ tret = remote_triton_rpc_rosd_create(0, oid, replication_factor, 0);
if(triton_is_error(tret) && !triton_error_equal(tret, TRITON_ERR_EXIST))
{
triton_error_print(tret, "remote_triton_rpc_rosd_create()");
diff --git a/code/src/asg/asg-internal.ae b/code/src/asg/asg-internal.ae
index 92fe79c..a40ccca 100644
--- a/code/src/asg/asg-internal.ae
+++ b/code/src/asg/asg-internal.ae
@@ -97,9 +97,6 @@ __blocking int asg_i_write (
const char * replication_factor_env;
uint32_t replication_factor;
//build oid and get server info from it;
- uint128_t oid;
- oid.u = object;
- oid.l = container;
/**
* last two args are: uint64_t txn_number, uint32_t flags;
@@ -122,7 +119,8 @@ __blocking int asg_i_write (
}
}
- tret = remote_triton_rpc_rosd_create(oid, replication_factor, 0);
+ tret = remote_triton_rpc_rosd_create(container, object,
+ replication_factor, 0);
if(triton_is_error(tret) && !triton_error_equal(TRITON_ERR_EXIST, tret))
{
triton_error_print(tret, "remote_triton_rpc_rosd_create");
@@ -130,7 +128,8 @@ __blocking int asg_i_write (
return(ASG_ERR_OTHER);
}
- tret = remote_triton_rpc_rosd_write(oid,
+ tret = remote_triton_rpc_rosd_write(container,
+ object,
fork,
data,
recordcount,
@@ -284,14 +283,11 @@ __blocking int asg_i_read (
triton_ret_t tret;
int64_t size;
- uint128_t oid;
-
- oid.u = object;
- oid.l = container;
size = MIN(bufsize, recordcount);
tret = remote_triton_rpc_rosd_read(
- oid,
+ container,
+ object,
fork,
buf,
size,
@@ -344,18 +340,14 @@ __blocking int asg_i_punch (
{
triton_ret_t tret;
- //build oid and get server info from it;
- uint128_t oid;
- oid.u = container;
- oid.l = object;
-
char *data="punch";
- tret = remote_triton_rpc_rosd_write(oid,
+ tret = remote_triton_rpc_rosd_write(container,
+ object,
fork,
data,
recordcount,
start_record,
- new_version,
+ version_condition,
flags);
if (triton_is_error(tret))
{
@@ -398,7 +390,6 @@ __blocking int asg_i_reset (
asg_size_t * reset_count)
{
triton_ret_t tret;
- uint128_t oid;
uint64_t count;
int rc;
@@ -415,11 +406,9 @@ __blocking int asg_i_reset (
return ASG_ERR_OTHER;
}
- oid.u = object;
- oid.l = container;
-
tret = remote_triton_rpc_rosd_reset(
- oid,
+ container,
+ object,
fork,
start_record,
recordcount,
@@ -526,7 +515,6 @@ __blocking int asg_i_probe_object (
asg_fork_id_t * next)
{
triton_ret_t tret;
- uint128_t r_oid;
uint64_t r_fid;
uint64_t r_next;
uint64_t r_count;
@@ -545,11 +533,10 @@ __blocking int asg_i_probe_object (
assert(ffork && flen && fcount);
- r_oid.u = object;
- r_oid.l = container;
r_fid = start;
- tret = remote_triton_rpc_rosd_probe_object(r_oid,
+ tret = remote_triton_rpc_rosd_probe_object(container,
+ object,
r_fid,
maxitems,
&r_count,
@@ -614,7 +601,6 @@ __blocking int asg_i_probe_fork (
asg_record_id_t * next)
{
triton_ret_t tret;
- uint128_t r_oid;
uint64_t r_fid;
uint64_t r_rid;
uint64_t r_count;
@@ -635,12 +621,11 @@ __blocking int asg_i_probe_fork (
assert(rrecord && rversion && rlen && rcount);
- r_oid.u = object;
- r_oid.l = container;
r_fid = fork;
r_rid = start;
- tret = remote_triton_rpc_rosd_probe_fork(r_oid,
+ tret = remote_triton_rpc_rosd_probe_fork(container,
+ object,
r_fid,
r_rid,
maxitems,
diff --git a/code/src/replicated-osd/rosd-create.ae b/code/src/replicated-osd/rosd-create.ae
index 9915a29..e86b0f5 100644
--- a/code/src/replicated-osd/rosd-create.ae
+++ b/code/src/replicated-osd/rosd-create.ae
@@ -18,12 +18,19 @@
/* Mercury RPC structures for rosd_create */
MERCURY_GEN_PROC(triton_rpc_rosd_create_out_t, ((triton_ret_t)(tret)))
-MERCURY_GEN_PROC(triton_rpc_rosd_create_in_t, ((uint128_t)(oid))((uint32_t)(flags))((uint32_t)(expected_position))((uint32_t)(replication_factor))((uint64_t)(niid)))
+MERCURY_GEN_PROC(triton_rpc_rosd_create_in_t,
+ ((uint64_t)(container))
+ ((uint64_t)(oid))
+ ((uint32_t)(flags))
+ ((uint32_t)(expected_position))
+ ((uint32_t)(replication_factor))
+ ((uint64_t)(niid)))
static hg_id_t rpc_rosd_create_id;
static hg_return_t triton_rpc_rosd_create_handler(hg_handle_t handle);
static __blocking triton_ret_t rosd_create_do_work(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags,
uint32_t replication_factor,
int my_position,
@@ -32,7 +39,8 @@ static __blocking triton_ret_t rosd_create_do_work(
int from_client_flag);
static int is_usage_error_create(triton_ret_t tret);
static __blocking triton_ret_t rosd_create_local_storage(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replication_factor,
uint64_t niid);
@@ -41,7 +49,6 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
triton_rpc_rosd_create_out_t out;
triton_rpc_rosd_create_in_t in;
int ret = 0;
- char *oid_str;
int my_position;
na_addr_t *addr_array = NULL;
int got_addrs = 0;
@@ -53,11 +60,10 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
triton_mercury_get_input(handle, &in, &out);
- oid_str = triton_uint128_to_string(in.oid);
-
- triton_debug(triton_dbg_rosd, "triton_rpc_rosd_create() params: oid: %s, flags: %d, replication_factor: %d, niid: %llu\n",
- oid_str, in.flags, in.replication_factor, llu(in.niid));
- if (oid_str) free(oid_str);
+ triton_debug(triton_dbg_rosd, "triton_rpc_rosd_create() params: "
+ "container:%lu oid: %lu, flags: %d, "
+ "replication_factor: %d, niid: %llu\n",
+ in.container, in.oid, in.flags, in.replication_factor, llu(in.niid));
out.tret = TRITON_SUCCESS;
@@ -73,8 +79,8 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
}
if(!triton_is_error(out.tret))
{
- out.tret = triton_oid_to_addrs(in.oid, actual_rep_factor, &my_position,
- addr_array);
+ out.tret = triton_oid64_to_addrs(in.oid, actual_rep_factor,
+ &my_position, addr_array);
if(!triton_is_error(out.tret))
got_addrs = 1;
}
@@ -92,9 +98,9 @@ static __blocking triton_ret_t triton_rpc_rosd_create(hg_handle_t handle)
next_addr = addr_array[my_position+1];
}
- out.tret = rosd_create_do_work(in.oid, in.flags, actual_rep_factor,
- my_position, next_addr, in.niid, 1);
-
+ out.tret = rosd_create_do_work(in.container, in.oid, in.flags,
+ actual_rep_factor, my_position, next_addr, in.niid, 1);
+
triton_mercury_respond(handle, &out);
HG_Destroy(handle);
@@ -110,7 +116,8 @@ TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_create)
__blocking triton_ret_t __remote_triton_rpc_rosd_create(
na_addr_t addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replicas,
uint32_t flags,
uint32_t expected_position)
@@ -122,6 +129,7 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_create(
int position;
hg_handle_t handle;
+ in.container = container;
in.oid = oid;
in.flags = flags;
in.replication_factor = replicas;
@@ -141,7 +149,8 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_create(
}
__blocking triton_ret_t remote_triton_rpc_rosd_create(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replicas,
uint32_t flags)
{
@@ -150,13 +159,14 @@ __blocking triton_ret_t remote_triton_rpc_rosd_create(
int position;
/* we contact the first server (master) for oid */
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
- tret = __remote_triton_rpc_rosd_create(addr, oid, replicas, flags, 0);
+ tret = __remote_triton_rpc_rosd_create(addr, container, oid, replicas,
+ flags, 0);
triton_mercury_addr_free(addr);
@@ -164,7 +174,8 @@ __blocking triton_ret_t remote_triton_rpc_rosd_create(
}
static __blocking triton_ret_t rosd_create_do_work(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags,
uint32_t replication_factor,
int my_position,
@@ -188,24 +199,24 @@ static __blocking triton_ret_t rosd_create_do_work(
{
if(my_position < replication_factor -1)
{
- oid_str = triton_uint128_to_string(oid);
- triton_debug(triton_dbg_rosd,
- "ROSD forwarding create of oid %s to %d'th server.\n",
- oid_str, my_position+1);
- if (oid_str) free(oid_str);
-
- remote_tret = __remote_triton_rpc_rosd_create(next_addr, oid,
- replication_factor, flags, my_position+1);
+ triton_debug(triton_dbg_rosd,
+ "ROSD forwarding create of oid %lu to %d'th server.\n",
+ oid, my_position+1);
+
+ remote_tret = __remote_triton_rpc_rosd_create(next_addr,
+ container, oid, replication_factor, flags,
+ my_position+1);
}
}
pbranch
{
- oid_str = triton_uint128_to_string(oid);
- triton_debug(triton_dbg_rosd, "ROSD local create of oid %s on %d'th server.\n", oid_str, my_position);
+ triton_debug(triton_dbg_rosd,
+ "ROSD local create of oid %lu on %d'th server.\n",
+ oid, my_position);
if (oid_str) free(oid_str);
/* perform local operation */
- local_tret = rosd_create_local_storage(oid, replication_factor,
- niid);
+ local_tret = rosd_create_local_storage(container, oid,
+ replication_factor, niid);
}
}
@@ -248,7 +259,8 @@ static int is_usage_error_create(triton_ret_t tret)
* performs the local steps needed in a replicated create
*/
static __blocking triton_ret_t rosd_create_local_storage(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replication_factor,
uint64_t niid
)
diff --git a/code/src/replicated-osd/rosd-internal.hae b/code/src/replicated-osd/rosd-internal.hae
index d0303f2..ad024d0 100644
--- a/code/src/replicated-osd/rosd-internal.hae
+++ b/code/src/replicated-osd/rosd-internal.hae
@@ -17,6 +17,12 @@ extern uint32_t rosd_default_replication_factor;
triton_ret_t asg_oid_to_addrs(uint64_t oid,
uint32_t replication_factor, int* my_position, na_addr_t *addr_array);
+triton_ret_t triton_oid64_to_addrs(
+ uint64_t oid,
+ uint32_t replication_factor,
+ int* my_position,
+ na_addr_t *addr_array);
+
triton_ret_t triton_oid_to_addrs(uint128_t oid,
uint32_t replication_factor, int* my_position, na_addr_t *addr_array);
@@ -35,8 +41,16 @@ __blocking triton_ret_t interpret_error(
__blocking void trigger_server_fault(triton_ret_t tret);
-__blocking triton_ret_t rosd_get_replication_factor (uint128_t oid, uint32_t *factor);
-__blocking triton_ret_t rosd_get_addr_list (uint128_t oid, na_addr_t **addr_array, uint32_t *rep_factor, int *my_pos);
+__blocking triton_ret_t rosd_get_replication_factor(
+ uint64_t container,
+ uint64_t oid,
+ uint32_t *factor);
+__blocking triton_ret_t rosd_get_addr_list(
+ uint64_t container,
+ uint64_t oid,
+ na_addr_t **addr_array,
+ uint32_t *rep_factor,
+ int *my_pos);
void triton_rpc_rosd_create_register(void);
void triton_rpc_rosd_range_register(void);
diff --git a/code/src/replicated-osd/rosd-probe-fork.ae b/code/src/replicated-osd/rosd-probe-fork.ae
index eab94f0..298f360 100644
--- a/code/src/replicated-osd/rosd-probe-fork.ae
+++ b/code/src/replicated-osd/rosd-probe-fork.ae
@@ -10,7 +10,8 @@
#include "src/remote/mercury-encode.h"
MERCURY_GEN_PROC(triton_rpc_rosd_probe_fork_in_t,
- ((uint128_t)(oid)) \
+ ((uint64_t)(container)) \
+ ((uint64_t)(oid)) \
((uint64_t)(fork)) \
((uint64_t)(record)) \
((uint64_t)(max)))
@@ -76,7 +77,8 @@ static __blocking triton_ret_t triton_rpc_rosd_probe_fork(hg_handle_t handle)
TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_probe_fork)
__blocking triton_ret_t remote_triton_rpc_rosd_probe_fork(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
uint64_t record,
uint64_t max,
@@ -95,12 +97,13 @@ __blocking triton_ret_t remote_triton_rpc_rosd_probe_fork(
triton_rpc_rosd_probe_fork_in_t in;
hg_handle_t handle;
+ in.container = container;
in.oid = oid;
in.fork = fork;
in.record = record;
in.max = max;
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-probe-object.ae b/code/src/replicated-osd/rosd-probe-object.ae
index c6b07b6..f9cc25a 100644
--- a/code/src/replicated-osd/rosd-probe-object.ae
+++ b/code/src/replicated-osd/rosd-probe-object.ae
@@ -10,7 +10,8 @@
#include "src/remote/mercury-encode.h"
MERCURY_GEN_PROC(triton_rpc_rosd_probe_object_in_t,
- ((uint128_t)(oid)) \
+ ((uint64_t)(container)) \
+ ((uint64_t)(oid)) \
((uint64_t)(fork)) \
((uint64_t)(max)))
@@ -61,7 +62,8 @@ static __blocking triton_ret_t triton_rpc_rosd_probe_object(hg_handle_t handle)
TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_probe_object)
__blocking triton_ret_t remote_triton_rpc_rosd_probe_object(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
uint64_t max,
uint64_t *count,
@@ -78,11 +80,12 @@ __blocking triton_ret_t remote_triton_rpc_rosd_probe_object(
triton_rpc_rosd_probe_object_out_t out;
triton_rpc_rosd_probe_object_in_t in;
+ in.container = container;
in.oid = oid;
in.fork = fork;
in.max = max;
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
diff --git a/code/src/replicated-osd/rosd-range.ae b/code/src/replicated-osd/rosd-range.ae
index 717a19c..3094fba 100644
--- a/code/src/replicated-osd/rosd-range.ae
+++ b/code/src/replicated-osd/rosd-range.ae
@@ -17,8 +17,9 @@
/* Mercury RPC structures for rosd_range */
MERCURY_GEN_PROC(triton_rpc_rosd_range_in_t,
- ((uint128_t)(lower))\
- ((uint128_t)(upper))\
+ ((uint64_t)(container))\
+ ((uint64_t)(lower))\
+ ((uint64_t)(upper))\
((uint32_t)(count)))
/* output struct for rosd_range has a manual encoder because it contains
* an array
@@ -26,8 +27,8 @@ MERCURY_GEN_PROC(triton_rpc_rosd_range_in_t,
typedef struct
{
triton_ret_t tret;
- uint128_t next_position;
- uint128_t* oid_array;
+ uint64_t next_position;
+ uint64_t* oid_array;
uint32_t oid_array_count;
} triton_rpc_rosd_range_out_t;
static hg_return_t hg_proc_triton_rpc_rosd_range_out_t(hg_proc_t proc, void* v_out_p);
@@ -47,9 +48,9 @@ static __blocking triton_ret_t triton_rpc_rosd_range(hg_handle_t handle)
triton_mercury_get_input(handle, &in, &out);
out.tret = TRITON_SUCCESS;
- triton_uint128_setmax(out.next_position);
+ out.next_position = UINT64_MAX;
out.oid_array_count = 0;
- out.oid_array = (uint128_t*)malloc(in.count*sizeof(*out.oid_array));
+ out.oid_array = malloc(in.count*sizeof(*out.oid_array));
if(!out.oid_array)
{
out.tret = TRITON_ERR_NOMEM;
@@ -82,12 +83,13 @@ TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_range)
__blocking triton_ret_t remote_triton_rpc_rosd_range(
na_addr_t addr,
- uint128_t lower,
- uint128_t upper,
+ uint64_t container,
+ uint64_t lower,
+ uint64_t upper,
uint32_t count,
- uint128_t *oid_array,
+ uint64_t *oid_array,
uint32_t *oid_array_count,
- uint128_t *next_position)
+ uint64_t *next_position)
{
triton_ret_t tret;
triton_rpc_rosd_range_out_t out;
@@ -95,6 +97,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_range(
int ret;
hg_handle_t handle;
+ in.container = container;
in.lower = lower;
in.upper = upper;
in.count = count;
@@ -140,7 +143,7 @@ static hg_return_t hg_proc_triton_rpc_rosd_range_out_t(hg_proc_t proc, void* v_o
HG_LOG_ERROR("Proc error");
return ret;
}
- ret = hg_proc_uint128_t(proc, &out_p->next_position);
+ ret = hg_proc_uint64_t(proc, &out_p->next_position);
if (ret != HG_SUCCESS) {
HG_LOG_ERROR("Proc error");
return ret;
@@ -152,7 +155,7 @@ static hg_return_t hg_proc_triton_rpc_rosd_range_out_t(hg_proc_t proc, void* v_o
}
for(i=0; i<out_p->oid_array_count; i++)
{
- ret = hg_proc_uint128_t(proc, &out_p->oid_array[i]);
+ ret = hg_proc_uint64_t(proc, &out_p->oid_array[i]);
if (ret != HG_SUCCESS) {
HG_LOG_ERROR("Proc error");
return ret;
@@ -165,7 +168,7 @@ static hg_return_t hg_proc_triton_rpc_rosd_range_out_t(hg_proc_t proc, void* v_o
HG_LOG_ERROR("Proc error");
return ret;
}
- ret = hg_proc_uint128_t(proc, &out_p->next_position);
+ ret = hg_proc_uint64_t(proc, &out_p->next_position);
if (ret != HG_SUCCESS) {
HG_LOG_ERROR("Proc error");
return ret;
@@ -175,7 +178,7 @@ static hg_return_t hg_proc_triton_rpc_rosd_range_out_t(hg_proc_t proc, void* v_o
HG_LOG_ERROR("Proc error");
return ret;
}
- out_p->oid_array = (uint128_t*)malloc(out_p->oid_array_count*
+ out_p->oid_array = malloc(out_p->oid_array_count*
sizeof(*out_p->oid_array));
if(!out_p->oid_array) {
HG_LOG_ERROR("Out of memory");
@@ -183,7 +186,7 @@ static hg_return_t hg_proc_triton_rpc_rosd_range_out_t(hg_proc_t proc, void* v_o
}
for(i=0; i<out_p->oid_array_count; i++)
{
- ret = hg_proc_uint128_t(proc, &out_p->oid_array[i]);
+ ret = hg_proc_uint64_t(proc, &out_p->oid_array[i]);
if (ret != HG_SUCCESS) {
HG_LOG_ERROR("Proc error");
return ret;
diff --git a/code/src/replicated-osd/rosd-read.ae b/code/src/replicated-osd/rosd-read.ae
index 0eebcc9..e869ee5 100644
--- a/code/src/replicated-osd/rosd-read.ae
+++ b/code/src/replicated-osd/rosd-read.ae
@@ -25,7 +25,8 @@ extern int64_t rosd_read_xfer_pipeline_depth;
/* Mercury RPC structures for rosd_read */
MERCURY_GEN_PROC(triton_rpc_rosd_read_in_t,
- ((uint128_t)(oid))\
+ ((uint64_t)(container))\
+ ((uint64_t)(oid))\
((uint64_t)(oid_fork))\
((int64_t)(size))\
((int64_t)(offset))\
@@ -43,7 +44,8 @@ static hg_return_t triton_rpc_rosd_read_handler(hg_handle_t handle);
extern struct buffer_mgmt_instance* rosd_read_buffers;
__blocking triton_ret_t remote_triton_rpc_rosd_read(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
char* buffer,
int64_t size,
@@ -63,12 +65,13 @@ __blocking triton_ret_t remote_triton_rpc_rosd_read(
/* TODO: ability read from replicas as well */
/* we contact the first server (master) for oid */
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
-
+
+ in.container = container;
in.oid = oid;
in.oid_fork = fork;
in.size = size;
@@ -105,7 +108,8 @@ __blocking triton_ret_t remote_triton_rpc_rosd_read(
static __blocking triton_ret_t rosd_read_xfer_one_buffer(
struct hg_info *hg_info,
char* tmp_buffer,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
int64_t size,
int64_t offset,
@@ -191,7 +195,7 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
/* check our position assuming a replication factor of 1 to make
* sure that we are the master for this object
*/
- out.tret = triton_oid_to_addrs(in.oid, 1, &my_position, &next_addr);
+ out.tret = triton_oid64_to_addrs(in.oid, 1, &my_position, &next_addr);
if(triton_is_error(out.tret))
{
triton_mercury_respond(handle, &out);
@@ -273,6 +277,7 @@ static __blocking triton_ret_t triton_rpc_rosd_read(hg_handle_t handle)
tret = rosd_read_xfer_one_buffer(
hg_info,
buffer,
+ in.container,
in.oid,
in.oid_fork,
this_size,
diff --git a/code/src/replicated-osd/rosd-remove.ae b/code/src/replicated-osd/rosd-remove.ae
index 8999847..2a16d73 100644
--- a/code/src/replicated-osd/rosd-remove.ae
+++ b/code/src/replicated-osd/rosd-remove.ae
@@ -21,10 +21,11 @@
MERCURY_GEN_PROC(triton_rpc_rosd_remove_out_t,
((triton_ret_t)(tret)))
MERCURY_GEN_PROC(triton_rpc_rosd_remove_in_t,
- ((uint128_t)(oid))\
- ((uint32_t)(flags))\
- ((uint32_t)(expected_position))\
- ((uint32_t)(replication_factor))\
+ ((uint64_t)(container))
+ ((uint64_t)(oid))
+ ((uint32_t)(flags))
+ ((uint32_t)(expected_position))
+ ((uint32_t)(replication_factor))
((uint64_t)(niid)))
@@ -32,9 +33,13 @@ static int is_usage_error_remove(triton_ret_t tret);
static hg_id_t rpc_rosd_remove_id;
static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle);
static hg_return_t triton_rpc_rosd_remove_handler(hg_handle_t handle);
-static __blocking triton_ret_t rosd_remove_local_storage(uint128_t oid, uint64_t niid);
+static __blocking triton_ret_t rosd_remove_local_storage(
+ uint64_t container,
+ uint64_t oid,
+ uint64_t niid);
static __blocking triton_ret_t rosd_remove_do_work(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags,
uint32_t replication_factor,
int my_position,
@@ -43,12 +48,14 @@ static __blocking triton_ret_t rosd_remove_do_work(
int from_client_flag);
__blocking triton_ret_t __remote_triton_rpc_rosd_remove(
na_addr_t addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replicas,
uint32_t flags,
uint32_t expected_position);
__blocking triton_ret_t remote_triton_rpc_rosd_remove(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags);
void triton_rpc_rosd_remove_register(void)
@@ -97,10 +104,11 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
triton_mercury_get_input(handle, &in, &out);
- oid_str = triton_uint128_to_string(in.oid);
triton_debug(triton_dbg_rosd,
- "triton_rpc_rosd_remove() params: oid: %s, flags: %d, replication_factor: %d, niid: %llu, position:%d\n",
- oid_str,
+ "triton_rpc_rosd_remove() params: container: %lu, oid: %lu,"
+ "flags: %d, replication_factor: %d, niid: %llu, position:%d\n",
+ in.container,
+ in.oid,
in.flags,
in.replication_factor,
llu(in.niid),
@@ -166,7 +174,7 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
else if (triton_error_equal(trc, TRITON_SUCCESS))
{
memset(addr_array, 0, in.replication_factor*sizeof(*addr_array));
- out.tret = triton_oid_to_addrs(in.oid,
+ out.tret = triton_oid64_to_addrs(in.oid,
in.replication_factor,
&my_position,
addr_array);
@@ -183,7 +191,8 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
next_addr = NA_ADDR_NULL;
}
- out.tret = rosd_remove_do_work(in.oid,
+ out.tret = rosd_remove_do_work(in.container,
+ in.oid,
in.flags,
in.replication_factor,
my_position,
@@ -222,7 +231,8 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_remove)
static __blocking triton_ret_t rosd_remove_do_work(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags,
uint32_t replication_factor,
int my_position,
@@ -240,18 +250,16 @@ static __blocking triton_ret_t rosd_remove_do_work(
pwait
{
- pprivate char *oid_str;
pbranch
{
/* forward on to peers if necessary */
if(my_position < replication_factor-1)
{
- oid_str = triton_uint128_to_string(oid);
- triton_debug(triton_dbg_rosd, "ROSD forwarding remove of oid %s to %d'th server.\n", oid_str, my_position+1);
- if (oid_str) free(oid_str);
+ triton_debug(triton_dbg_rosd, "ROSD forwarding remove of oid %lu to %d'th server.\n", oid, my_position+1);
remote_tret = __remote_triton_rpc_rosd_remove(
next_addr,
+ container,
oid,
replication_factor,
flags,
@@ -260,11 +268,9 @@ static __blocking triton_ret_t rosd_remove_do_work(
}
pbranch
{
- oid_str = triton_uint128_to_string(oid);
- triton_debug(triton_dbg_rosd, "ROSD local remove of oid %s on %d'th server.\n", oid_str, my_position);
- if (oid_str) free(oid_str);
+ triton_debug(triton_dbg_rosd, "ROSD local remove of oid %lu on %d'th server.\n", oid, my_position);
/* perform local operation */
- local_tret = rosd_remove_local_storage(oid, niid);
+ local_tret = rosd_remove_local_storage(container, oid, niid);
}
}
@@ -286,7 +292,8 @@ static __blocking triton_ret_t rosd_remove_do_work(
* - removes actual data on storage
*/
__blocking triton_ret_t rosd_remove_local_storage(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t niid)
{
triton_ret_t tret;
@@ -312,7 +319,8 @@ __blocking triton_ret_t rosd_remove_local_storage(
*/
__blocking triton_ret_t __remote_triton_rpc_rosd_remove(
na_addr_t addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replicas,
uint32_t flags,
uint32_t expected_position)
@@ -325,15 +333,17 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_remove(
char *oid_str;
hg_handle_t handle;
+ in.container = container;
in.oid = oid;
in.flags = flags;
in.replication_factor = replicas;
in.niid = 0; /* TODO: generate real NIIDs */
in.expected_position = expected_position;
- oid_str = triton_uint128_to_string(in.oid);
- triton_debug(triton_dbg_rosd, "__remote_triton_rpc_rosd_remove: post: oid=%s flags=%d rf=%d niid=%lld pos=%d\n", oid_str, in.flags, in.replication_factor, lld(in.niid), in.expected_position);
- if (oid_str) free(oid_str);
+ triton_debug(triton_dbg_rosd, "__remote_triton_rpc_rosd_remove: post: "
+ "container=%lu oid=%lu flags=%d rf=%d niid=%lld pos=%d\n",
+ in.container, in.oid, in.flags, in.replication_factor,
+ lld(in.niid), in.expected_position);
triton_mercury_run_rpc(addr, rpc_rosd_remove_id, handle, &in, &out);
@@ -351,7 +361,8 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_remove(
* - wrapper for initiating RPC for rosd_remove
*/
__blocking triton_ret_t remote_triton_rpc_rosd_remove(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags)
{
triton_ret_t tret;
@@ -359,13 +370,13 @@ __blocking triton_ret_t remote_triton_rpc_rosd_remove(
int position;
/* we contact the first server (master) for oid */
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
- tret = __remote_triton_rpc_rosd_remove(addr, oid, 0, flags, 0);
+ tret = __remote_triton_rpc_rosd_remove(addr, container, oid, 0, flags, 0);
triton_mercury_addr_free(addr);
diff --git a/code/src/replicated-osd/rosd-reset.ae b/code/src/replicated-osd/rosd-reset.ae
index 85df2a0..bdfd5f2 100644
--- a/code/src/replicated-osd/rosd-reset.ae
+++ b/code/src/replicated-osd/rosd-reset.ae
@@ -13,12 +13,21 @@
static int is_usage_error_reset(triton_ret_t tret);
__blocking triton_ret_t __remote_triton_rpc_rosd_reset(
- na_addr_t addr, uint128_t oid, uint64_t fork, uint64_t record,
- uint64_t rcount, uint64_t rlen, int flags, uint64_t condition,
- uint64_t *reset_count, int32_t position);
+ na_addr_t addr,
+ uint64_t container,
+ uint64_t oid,
+ uint64_t fork,
+ uint64_t record,
+ uint64_t rcount,
+ uint64_t rlen,
+ int flags,
+ uint64_t condition,
+ uint64_t *reset_count,
+ int32_t position);
MERCURY_GEN_PROC(triton_rpc_rosd_reset_in_t,
- ((uint128_t)(oid)) \
+ ((uint64_t)(container)) \
+ ((uint64_t)(oid)) \
((uint64_t)(fork)) \
((uint64_t)(record)) \
((uint64_t)(rcount)) \
@@ -55,19 +64,20 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
my_pos = -1;
addr_array = NULL;
- tret = rosd_get_addr_list(in.oid, &addr_array, &rep_factor, &my_pos);
+ tret = rosd_get_addr_list(in.container, in.oid, &addr_array, &rep_factor,
+ &my_pos);
if (in.int_pos != my_pos)
{
// wrong server
tret = TRITON_ERR_WRONG_SERVER;
}
- else if (in.oid.l == ASG_CONTAINER_NULL)
+ else if (in.container == ASG_CONTAINER_NULL)
{
// reset everything
tret = TRITON_ERR_NOSYS;
}
- else if (in.oid.u == ASG_OBJECT_NULL)
+ else if (in.oid == ASG_OBJECT_NULL)
{
// reset all objects in the container
tret = TRITON_ERR_NOSYS;
@@ -75,7 +85,7 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
else if (in.fork == ASG_FORK_NULL)
{
// reset an entire object
- tret = remote_triton_rpc_rosd_remove(in.oid, in.flags);
+ tret = remote_triton_rpc_rosd_remove(0, in.oid, in.flags);
}
else if (in.record == ASG_RECORD_NULL)
{
@@ -100,6 +110,7 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
{
r_tret = __remote_triton_rpc_rosd_reset(
addr_array[my_pos+1],
+ in.container,
in.oid,
in.fork,
in.record,
@@ -116,7 +127,7 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
}
}
pbranch
- {
+ {
// modify local records
l_tret = TRITON_ERR_NOT_IMPLEMENTED;
/* TODO: REPLACEME
@@ -162,7 +173,8 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
TRITON_DEFINE_RPC_HANDLER(triton_rpc_rosd_reset)
__blocking triton_ret_t remote_triton_rpc_rosd_reset(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
uint64_t record,
uint64_t rcount,
@@ -175,7 +187,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_reset(
na_addr_t addr;
int32_t position;
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
@@ -184,6 +196,7 @@ __blocking triton_ret_t remote_triton_rpc_rosd_reset(
triton_error_destroy(tret);
tret = __remote_triton_rpc_rosd_reset(addr,
+ container,
oid,
fork,
record,
@@ -202,7 +215,8 @@ __blocking triton_ret_t remote_triton_rpc_rosd_reset(
__blocking triton_ret_t __remote_triton_rpc_rosd_reset(
na_addr_t addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
uint64_t record,
uint64_t rcount,
@@ -218,6 +232,7 @@ __blocking triton_ret_t __remote_triton_rpc_rosd_reset(
triton_rpc_rosd_reset_in_t in;
hg_handle_t handle;
+ in.container = container;
in.oid = oid;
in.fork = fork;
in.record = record;
diff --git a/code/src/replicated-osd/rosd-txn-nr-cache.ae b/code/src/replicated-osd/rosd-txn-nr-cache.ae
index 910b383..88fec41 100644
--- a/code/src/replicated-osd/rosd-txn-nr-cache.ae
+++ b/code/src/replicated-osd/rosd-txn-nr-cache.ae
@@ -73,7 +73,12 @@ void txn_nr_cache_finalize(void)
return;
}
-__blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint128_t oid, uint64_t* next_txn_number, int flags)
+__blocking triton_ret_t txn_nr_cache_get(
+ struct txn_nr_cache_entry **entry,
+ uint64_t container,
+ uint64_t oid,
+ uint64_t* next_txn_number,
+ int flags)
{
struct triton_hash_link* tmp_link;
struct txn_nr_cache_entry* tmp_entry;
@@ -111,11 +116,9 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
tmp_entry->txn_number++;
*next_txn_number = tmp_entry->txn_number;
}
- oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd_txncache,
- "returning cached entry for oid %s: txn_number: %llu\n", oid_str,
+ "returning cached entry for oid %lu: txn_number: %llu\n", oid,
llu(*next_txn_number));
- if(oid_str) free(oid_str);
}
else
{
@@ -125,6 +128,7 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
tmp_entry = malloc(sizeof(*tmp_entry));
memset(tmp_entry, 0, sizeof(*tmp_entry));
+ tmp_entry->container = container;
tmp_entry->oid = oid;
tmp_entry->ref_count = 1;
/* pull current txn_number from tosd */
@@ -191,12 +195,9 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
if(!(flags & ROSD_FLAG_COND_WRITE))
*next_txn_number = tmp_entry->txn_number;
- oid_str = triton_uint128_to_string(oid);
triton_debug(triton_dbg_rosd_txncache,
- "generating new cache entry for oid %s: txn_number: %llu\n", oid_str,
+ "generating new cache entry for oid %lu: txn_number: %llu\n", oid,
llu(*next_txn_number));
- if (oid_str) free(oid_str);
-
}
/* discard idle entries if cache is now too big */
@@ -206,10 +207,8 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
{
dead_entry = triton_list_get_entry(iterator, struct txn_nr_cache_entry,
lru_link);
- oid_str = triton_uint128_to_string(dead_entry->oid);
triton_debug(triton_dbg_rosd_txncache,
- "removing stale oid %s from cache\n", oid_str);
- if(oid_str) free(oid_str);
+ "removing stale oid %lu from cache\n", oid);
triton_list_del(&dead_entry->lru_link);
triton_list_del(&dead_entry->hash_link);
txn_nr_cache_destructor(dead_entry); /* decrements hash count too */
@@ -228,14 +227,11 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
void txn_nr_cache_put(struct txn_nr_cache_entry* entry)
{
- char *oid_str;
-
triton_mutex_lock(&txn_nr_mutex);
assert(oid_table);
entry->ref_count--;
assert(entry->ref_count >= 0);
- oid_str = triton_uint128_to_string(entry->oid);
/* if ref count hits zero, then add to lru list as a candidate to be
* dropped from the cache later
@@ -243,16 +239,15 @@ void txn_nr_cache_put(struct txn_nr_cache_entry* entry)
if(entry->ref_count == 0)
{
triton_debug(triton_dbg_rosd_txncache,
- "putting oid %s from cache, adding to lru list\n", oid_str);
+ "putting oid %lu from cache, adding to lru list\n", entry->oid);
assert(entry->lru_link.prev == NULL);
triton_list_add_back(&entry->lru_link, &lru_list);
}
else
{
triton_debug(triton_dbg_rosd_txncache,
- "putting oid %s from cache, still active\n", oid_str);
+ "putting oid %lu from cache, still active\n", entry->oid);
}
- if (oid_str) free(oid_str);
triton_mutex_unlock(&txn_nr_mutex);
return;
}
@@ -262,10 +257,7 @@ static int oid_compare(const void *key, struct triton_hash_link *hash_link)
struct txn_nr_cache_entry *entry;
entry = triton_hash_get_entry(hash_link, struct txn_nr_cache_entry, hash_link);
- if(triton_cmp_uint128(*((const uint128_t*)key), entry->oid) == 0)
- return(1);
- else
- return(0);
+ return *((const uint64_t*) key) == entry->oid;
}
static void txn_nr_cache_destructor(struct txn_nr_cache_entry* entry)
diff --git a/code/src/replicated-osd/rosd-txn-nr-cache.hae b/code/src/replicated-osd/rosd-txn-nr-cache.hae
index f38e16f..6ad4296 100644
--- a/code/src/replicated-osd/rosd-txn-nr-cache.hae
+++ b/code/src/replicated-osd/rosd-txn-nr-cache.hae
@@ -25,7 +25,8 @@
struct txn_nr_cache_entry
{
- uint128_t oid;
+ uint64_t container;
+ uint64_t oid;
uint64_t txn_number;
int ref_count;
triton_list_link_t hash_link; /* link to hash table */
@@ -47,7 +48,8 @@ void txn_nr_cache_finalize(void);
*/
__blocking triton_ret_t txn_nr_cache_get(
struct txn_nr_cache_entry** entry,
- uint128_t oid, /**< object ID */
+ uint64_t container,
+ uint64_t oid,
uint64_t* next_txn_number, /**< next txn number to use */
int flags
);
diff --git a/code/src/replicated-osd/rosd-util.ae b/code/src/replicated-osd/rosd-util.ae
index 8f0628c..45746f3 100644
--- a/code/src/replicated-osd/rosd-util.ae
+++ b/code/src/replicated-osd/rosd-util.ae
@@ -1,7 +1,9 @@
#include "src/replicated-osd/rosd-internal.hae"
-__blocking triton_ret_t rosd_get_replication_factor (uint128_t oid,
- uint32_t *factor)
+__blocking triton_ret_t rosd_get_replication_factor(
+ uint64_t container,
+ uint64_t oid,
+ uint32_t *factor)
{
triton_ret_t tret;
uint32_t replication_factor;
@@ -44,10 +46,12 @@ __blocking triton_ret_t rosd_get_replication_factor (uint128_t oid,
return tret;
}
-__blocking triton_ret_t rosd_get_addr_list (uint128_t oid,
- na_addr_t **addr_array,
- uint32_t *rep_factor,
- int *my_pos)
+__blocking triton_ret_t rosd_get_addr_list(
+ uint64_t container,
+ uint64_t oid,
+ na_addr_t **addr_array,
+ uint32_t *rep_factor,
+ int *my_pos)
{
triton_ret_t tret;
na_addr_t *addrs;
@@ -57,14 +61,14 @@ __blocking triton_ret_t rosd_get_addr_list (uint128_t oid,
*rep_factor = 0;
*addr_array = NULL;
- tret = rosd_get_replication_factor(oid, &factor);
+ tret = rosd_get_replication_factor(container, oid, &factor);
if (!triton_is_error(tret))
{
addrs = malloc(factor*sizeof(na_addr_t*));
if (!addrs)
{
triton_error_destroy(tret);
- tret = triton_oid_to_addrs(oid, factor, &pos, addrs);
+ tret = triton_oid64_to_addrs(oid, factor, &pos, addrs);
if (!triton_is_error(tret))
{
*rep_factor = factor;
diff --git a/code/src/replicated-osd/rosd-write.ae b/code/src/replicated-osd/rosd-write.ae
index 14af635..74fab1e 100644
--- a/code/src/replicated-osd/rosd-write.ae
+++ b/code/src/replicated-osd/rosd-write.ae
@@ -25,7 +25,8 @@ extern int64_t rosd_write_xfer_pipeline_depth;
/* Mercury RPC structures for rosd_write */
MERCURY_GEN_PROC(triton_rpc_rosd_write_out_t, ((triton_ret_t)(tret)))
MERCURY_GEN_PROC(triton_rpc_rosd_write_in_t,
- ((uint128_t)(oid))\
+ ((uint64_t)(container))\
+ ((uint64_t)(oid))\
((uint64_t)(oid_fork))\
((int64_t)(offset))\
((int64_t)(size))\
@@ -42,7 +43,8 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle);
static hg_return_t triton_rpc_rosd_write_handler(hg_handle_t handle);
static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
na_addr_t addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
char* buffer,
int64_t size,
@@ -54,7 +56,8 @@ static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
static int is_usage_error_write(triton_ret_t tret);
static __blocking triton_ret_t rosd_write_do_work(
na_addr_t next_addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t oid_fork,
char* buffer,
int64_t size,
@@ -65,7 +68,8 @@ static __blocking triton_ret_t rosd_write_do_work(
int my_position,
int from_client_flag);
static __blocking triton_ret_t rosd_write_local_storage(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t oid_fork,
uint64_t txn_number,
char *buffer,
@@ -75,7 +79,8 @@ static __blocking triton_ret_t rosd_write_local_storage(
__blocking triton_ret_t remote_triton_rpc_rosd_write(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
char* buffer,
int64_t size,
@@ -88,13 +93,14 @@ __blocking triton_ret_t remote_triton_rpc_rosd_write(
int position;
/* we contact the first server (master) for oid */
- tret = triton_oid_to_addrs(oid, 1, &position, &addr);
+ tret = triton_oid64_to_addrs(oid, 1, &position, &addr);
if(triton_is_error(tret))
{
return(tret);
}
- tret = __remote_triton_rpc_rosd_write(addr, oid, fork, buffer, size, offset, flags, 0, 0, txn_number);
+ tret = __remote_triton_rpc_rosd_write(addr, container, oid, fork, buffer,
+ size, offset, flags, 0, 0, txn_number);
triton_mercury_addr_free(addr);
@@ -106,8 +112,6 @@ static __blocking triton_ret_t rosd_write_pull_one_buffer(
hg_handle_t handle,
na_addr_t src_addr,
char* tmp_buffer,
- uint128_t oid,
- uint64_t fork,
int64_t size,
int64_t remote_offset,
hg_bulk_t remote_bulk_handle)
@@ -198,8 +202,6 @@ static __blocking triton_ret_t rosd_write_run_iteration(
handle,
src_addr,
*buffer,
- in->oid,
- in->oid_fork,
*this_size,
this_remote_offset,
in->bulk_handle);
@@ -211,9 +213,9 @@ static __blocking triton_ret_t rosd_write_run_iteration(
//triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch finished pull_one_buffer().\n");
//triton_debug(triton_dbg_rosd, "triton_rpc_rosd_write() pbranch starting do_work().\n");
- tret = rosd_write_do_work(next_addr, in->oid,
- in->oid_fork, *buffer, *this_size, this_local_offset,
- in->flags, in->replication_factor, in->txn_number,
+ tret = rosd_write_do_work(next_addr, in->container, in->oid,
+ in->oid_fork, *buffer, *this_size, this_local_offset,
+ in->flags, in->replication_factor, in->txn_number,
my_position, from_client_flag);
if(triton_is_error(tret))
{
@@ -342,7 +344,7 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
/* check our position assuming a replication factor of 1 to make
* sure that we are the master for this object
*/
- out.tret = triton_oid_to_addrs(in.oid, 1, &my_position, &next_addr);
+ out.tret = triton_oid64_to_addrs(in.oid, 1, &my_position, &next_addr);
if(triton_is_error(out.tret))
{
triton_mercury_respond(handle, &out);
@@ -380,7 +382,8 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
/* TODO: check flags to make sure this isn't an explicit conditional */
/* figure out what transaction number to use */
- out.tret = txn_nr_cache_get(&entry_p, in.oid, &in.txn_number, in.flags);
+ out.tret = txn_nr_cache_get(&entry_p, in.container, in.oid,
+ &in.txn_number, in.flags);
if(triton_is_error(out.tret))
{
triton_error_msg("txn_nr_cache_get() failure.\n");
@@ -400,8 +403,8 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
return(TRITON_SUCCESS);
}
- out.tret = triton_oid_to_addrs(in.oid, in.replication_factor, &my_position,
- addr_array);
+ out.tret = triton_oid64_to_addrs(in.oid, in.replication_factor,
+ &my_position, addr_array);
if(triton_is_error(out.tret))
{
if(entry_p)
@@ -460,7 +463,8 @@ void triton_rpc_rosd_write_register(void)
static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
na_addr_t addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
char* buffer,
int64_t size,
@@ -477,6 +481,7 @@ static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
hg_handle_t handle = HG_HANDLE_NULL;
size_t bulk_size = size;
+ in.container = container;
in.oid = oid;
in.oid_fork = fork;
in.offset = offset;
@@ -501,7 +506,8 @@ static __blocking triton_ret_t __remote_triton_rpc_rosd_write(
static __blocking triton_ret_t rosd_write_do_work(
na_addr_t next_addr,
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t oid_fork,
char* buffer,
int64_t size,
@@ -523,29 +529,24 @@ static __blocking triton_ret_t rosd_write_do_work(
/* TODO: implement conditionals */
pwait
{
- pprivate char* oid_str;
pbranch
{
/* forward on to peers if necessary */
if(my_position < replication_factor-1)
{
- oid_str = triton_uint128_to_string(oid);
- triton_debug(triton_dbg_rosd, "ROSD forwarding write of oid %s to %d'th server.\n", oid_str, my_position+1);
- if (oid_str) free(oid_str);
+ triton_debug(triton_dbg_rosd, "ROSD forwarding write of oid %lu to %d'th server.\n", oid, my_position+1);
remote_tret = __remote_triton_rpc_rosd_write(
- next_addr, oid, oid_fork, buffer, size, offset, flags, replication_factor,
- my_position+1, txn_number);
+ next_addr, container, oid, oid_fork, buffer, size, offset,
+ flags, replication_factor, my_position+1, txn_number);
}
}
pbranch
{
- oid_str = triton_uint128_to_string(oid);
- triton_debug(triton_dbg_rosd, "ROSD local write of oid %s on %d'th server, transaction number %llu.\n", oid_str, my_position, llu(txn_number));
- if (oid_str) free(oid_str);
+ triton_debug(triton_dbg_rosd, "ROSD local write of oid %lu on %d'th server, transaction number %llu.\n", oid, my_position, llu(txn_number));
/* perform local operation */
- local_tret = rosd_write_local_storage(oid, oid_fork, txn_number,
- buffer, size, offset, flags);
+ local_tret = rosd_write_local_storage(container, oid, oid_fork,
+ txn_number, buffer, size, offset, flags);
}
}
@@ -588,7 +589,8 @@ static int is_usage_error_write(triton_ret_t tret)
* performs the local steps needed in a replicated write
*/
static __blocking triton_ret_t rosd_write_local_storage(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t oid_fork,
uint64_t txn_number,
char *buffer,
diff --git a/code/src/replicated-osd/rosd.ae b/code/src/replicated-osd/rosd.ae
index b2f3da4..91455ad 100644
--- a/code/src/replicated-osd/rosd.ae
+++ b/code/src/replicated-osd/rosd.ae
@@ -6,6 +6,7 @@
#include <triton-base.h>
#include <mercury_macros.h>
#include <mercury_proc.h>
+#include <triton-uint128.h>
#include "src/replicated-osd/rosd.hae"
#include "src/replicated-osd/buffer-mgmt.hae"
@@ -191,6 +192,75 @@ triton_ret_t asg_oid_to_addrs(uint64_t oid, uint32_t replication_factor, int* my
/* a 64-bit version of triton_oid_to_addrs. Once the ROSD interfaces are
* rewritten, we should replace it with this function */
+triton_ret_t triton_oid64_to_addrs(
+ uint64_t oid,
+ uint32_t replication_factor,
+ int* my_position,
+ na_addr_t *addr_array) {
+ triton_ret_t tret;
+ char* svr_string;
+ triton_node_t* target_nodes;
+ int i;
+ triton_node_t self;
+ char *oid_str;
+ uint128_t oid_l;
+
+ *my_position = -1;
+
+ self = triton_self_node();
+
+ target_nodes = malloc(replication_factor*sizeof(*target_nodes));
+ if(!target_nodes)
+ {
+ return(TRITON_ERR_NOMEM);
+ }
+
+ /* TODO: need to check status of nodes; for now just assuming all of
+ * them are valid. This could just be a filter function that reduces
+ * the array to only include nodes that are valid targets.
+ */
+
+ tret = triton_place_lookup(oid, target_nodes, replication_factor);
+ if(triton_is_error(tret))
+ {
+ free(target_nodes);
+ return(tret);
+ }
+
+
+ oid_l = triton_uint128_from_uint64(oid);
+ oid_str = triton_uint128_to_string(oid_l);
+
+ for(i=0; i<replication_factor; i++)
+ {
+ if(triton_node_equal(self, target_nodes[i]))
+ *my_position = i;
+
+ svr_string = system_state_get(target_nodes[i], "addr");
+ if(!svr_string)
+ {
+ free(target_nodes);
+ return(TRITON_ERR_UNKNOWN);
+ }
+
+ triton_debug(triton_dbg_rosd, "triton_oid_to_addrs() mapped oid %s to server %d: %s\n", oid_str, i, svr_string);
+
+ tret = triton_mercury_addr_lookup(svr_string, &addr_array[i]);
+ if(triton_is_error(tret))
+ {
+ free(target_nodes);
+ free(svr_string);
+ return(tret);
+ }
+
+ free(svr_string);
+ }
+
+ if (oid_str) free(oid_str);
+ free(target_nodes);
+
+ return(TRITON_SUCCESS);
+}
/* checks system state and runs placement to identify addresses responsible
* for a given oid.
diff --git a/code/src/replicated-osd/rosd.hae b/code/src/replicated-osd/rosd.hae
index 567e799..2ff39ca 100644
--- a/code/src/replicated-osd/rosd.hae
+++ b/code/src/replicated-osd/rosd.hae
@@ -6,7 +6,6 @@
#include <mercury.h>
#include <sos.hae>
-#include <triton-uint128.h>
#include "src/common/triton-error.h"
#include "src/replicated-osd/buffer-mgmt.hae"
@@ -34,26 +33,30 @@ void triton_rpc_rosd_register(void);
/* if replicas == 0, then use the system default replication factor */
__blocking triton_ret_t remote_triton_rpc_rosd_create(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t replicas,
uint32_t flags);
__blocking triton_ret_t remote_triton_rpc_rosd_remove(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint32_t flags);
__blocking triton_ret_t remote_triton_rpc_rosd_range(
na_addr_t addr,
- uint128_t lower,
- uint128_t upper,
+ uint64_t container,
+ uint64_t lower,
+ uint64_t upper,
uint32_t count,
- uint128_t *oid_array,
+ uint64_t *oid_array,
uint32_t *oid_array_count,
- uint128_t *next_position);
+ uint64_t *next_position);
/* TODO: make const correct (needs some downstream fixes also) */
__blocking triton_ret_t remote_triton_rpc_rosd_write(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
char* buffer,
int64_t size,
@@ -76,7 +79,8 @@ __blocking triton_ret_t remote_triton_rpc_rsos_write(
uint32_t replication_factor);
__blocking triton_ret_t remote_triton_rpc_rosd_read(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
char* buffer,
int64_t size,
@@ -111,7 +115,8 @@ __blocking triton_ret_t rosd_pipeline_setup_one_buffer(
);
__blocking triton_ret_t remote_triton_rpc_rosd_probe_fork(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
uint64_t record,
uint64_t max,
@@ -123,7 +128,8 @@ __blocking triton_ret_t remote_triton_rpc_rosd_probe_fork(
uint64_t *rcount);
__blocking triton_ret_t remote_triton_rpc_rosd_probe_object(
- uint128_t oid,
+ uint64_t container,
+ uint64_t oid,
uint64_t fork,
uint64_t max,
uint64_t *count,
@@ -133,7 +139,8 @@ __blocking triton_ret_t remote_triton_rpc_rosd_probe_object(
uint64_t *fcount);
__blocking triton_ret_t remote_triton_rpc_rosd_reset(
- uint128_t oid,
+ uint64_t container,
+ uint64_t object,
uint64_t fork,
uint64_t record,
uint64_t rcount,
hooks/post-receive
--
1
0
branch, trac-323-sos, updated. 8ab1b209b03fc6821e9a5f01534231f366b02b2c
by noreply@mcs.anl.gov 19 Dec '14
by noreply@mcs.anl.gov 19 Dec '14
19 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via 8ab1b209b03fc6821e9a5f01534231f366b02b2c (commit)
from 76f4eb5953c0ee4ab8f7132fe71c0b4b7703ca42 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8ab1b209b03fc6821e9a5f01534231f366b02b2c
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 12:37:53 2014 -0600
mv TOSD to the dustbin of history
tosd calls have been commented out, to be replaced later with sos equivalents
where applicable
-----------------------------------------------------------------------
Summary of changes:
code/Makefile.am | 2 +-
.../tests/transactional-osd/bdb-snapshot-write.c | 0
.../tests/transactional-osd/bdb-snapshot-write.sh | 0
.../tests/transactional-osd/tosd-bench-create.ae | 0
.../tests/transactional-osd/tosd-bench-create.sh | 0
.../tosd}/tests/transactional-osd/tosd1.ae | 0
.../tosd}/transactional-osd/Makefile.subdir | 0
.../tosd}/transactional-osd/tosd-fd-cache.ae | 0
.../tosd}/transactional-osd/tosd-fd-cache.hae | 0
.../tosd}/transactional-osd/transactional-osd.ae | 0
.../tosd}/transactional-osd/transactional-osd.hae | 0
code/src/replicated-osd/rosd-create.ae | 8 +++-
code/src/replicated-osd/rosd-probe-fork.ae | 4 ++-
code/src/replicated-osd/rosd-probe-object.ae | 4 ++-
code/src/replicated-osd/rosd-range.ae | 4 ++-
code/src/replicated-osd/rosd-read.ae | 4 ++-
code/src/replicated-osd/rosd-remove.ae | 7 +++-
code/src/replicated-osd/rosd-reset.ae | 4 ++-
code/src/replicated-osd/rosd-txn-nr-cache.ae | 4 ++-
code/src/replicated-osd/rosd-util.ae | 4 ++-
code/src/replicated-osd/rosd-write.ae | 11 +++++-
code/src/replicated-osd/rosd.ae | 4 ++-
code/src/replicated-osd/rsos-read.ae | 1 -
code/src/replicated-osd/rsos-write.ae | 1 -
code/src/server/triton-server.ae | 15 +++++----
code/tests/Makefile.subdir | 34 +++++++++++--------
26 files changed, 74 insertions(+), 37 deletions(-)
rename code/{ => sandbox/tosd}/tests/transactional-osd/bdb-snapshot-write.c (100%)
rename code/{ => sandbox/tosd}/tests/transactional-osd/bdb-snapshot-write.sh (100%)
rename code/{ => sandbox/tosd}/tests/transactional-osd/tosd-bench-create.ae (100%)
rename code/{ => sandbox/tosd}/tests/transactional-osd/tosd-bench-create.sh (100%)
rename code/{ => sandbox/tosd}/tests/transactional-osd/tosd1.ae (100%)
rename code/{src => sandbox/tosd}/transactional-osd/Makefile.subdir (100%)
rename code/{src => sandbox/tosd}/transactional-osd/tosd-fd-cache.ae (100%)
rename code/{src => sandbox/tosd}/transactional-osd/tosd-fd-cache.hae (100%)
rename code/{src => sandbox/tosd}/transactional-osd/transactional-osd.ae (100%)
rename code/{src => sandbox/tosd}/transactional-osd/transactional-osd.hae (100%)
Diff of changes:
diff --git a/code/Makefile.am b/code/Makefile.am
index ba49844..a902926 100644
--- a/code/Makefile.am
+++ b/code/Makefile.am
@@ -57,7 +57,7 @@ include Make.rules
include $(top_srcdir)/src/common/Makefile.subdir
include $(top_srcdir)/src/zeroconf/Makefile.subdir
-include $(top_srcdir)/src/transactional-osd/Makefile.subdir
+#include $(top_srcdir)/src/transactional-osd/Makefile.subdir
include $(top_srcdir)/src/remote/Makefile.subdir
include $(top_srcdir)/src/replicated-osd/Makefile.subdir
include $(top_srcdir)/src/asg/Makefile.subdir
diff --git a/code/tests/transactional-osd/bdb-snapshot-write.c b/code/sandbox/tosd/tests/transactional-osd/bdb-snapshot-write.c
similarity index 100%
rename from code/tests/transactional-osd/bdb-snapshot-write.c
rename to code/sandbox/tosd/tests/transactional-osd/bdb-snapshot-write.c
diff --git a/code/tests/transactional-osd/bdb-snapshot-write.sh b/code/sandbox/tosd/tests/transactional-osd/bdb-snapshot-write.sh
similarity index 100%
rename from code/tests/transactional-osd/bdb-snapshot-write.sh
rename to code/sandbox/tosd/tests/transactional-osd/bdb-snapshot-write.sh
diff --git a/code/tests/transactional-osd/tosd-bench-create.ae b/code/sandbox/tosd/tests/transactional-osd/tosd-bench-create.ae
similarity index 100%
rename from code/tests/transactional-osd/tosd-bench-create.ae
rename to code/sandbox/tosd/tests/transactional-osd/tosd-bench-create.ae
diff --git a/code/tests/transactional-osd/tosd-bench-create.sh b/code/sandbox/tosd/tests/transactional-osd/tosd-bench-create.sh
similarity index 100%
rename from code/tests/transactional-osd/tosd-bench-create.sh
rename to code/sandbox/tosd/tests/transactional-osd/tosd-bench-create.sh
diff --git a/code/tests/transactional-osd/tosd1.ae b/code/sandbox/tosd/tests/transactional-osd/tosd1.ae
similarity index 100%
rename from code/tests/transactional-osd/tosd1.ae
rename to code/sandbox/tosd/tests/transactional-osd/tosd1.ae
diff --git a/code/src/transactional-osd/Makefile.subdir b/code/sandbox/tosd/transactional-osd/Makefile.subdir
similarity index 100%
rename from code/src/transactional-osd/Makefile.subdir
rename to code/sandbox/tosd/transactional-osd/Makefile.subdir
diff --git a/code/src/transactional-osd/tosd-fd-cache.ae b/code/sandbox/tosd/transactional-osd/tosd-fd-cache.ae
similarity index 100%
rename from code/src/transactional-osd/tosd-fd-cache.ae
rename to code/sandbox/tosd/transactional-osd/tosd-fd-cache.ae
diff --git a/code/src/transactional-osd/tosd-fd-cache.hae b/code/sandbox/tosd/transactional-osd/tosd-fd-cache.hae
similarity index 100%
rename from code/src/transactional-osd/tosd-fd-cache.hae
rename to code/sandbox/tosd/transactional-osd/tosd-fd-cache.hae
diff --git a/code/src/transactional-osd/transactional-osd.ae b/code/sandbox/tosd/transactional-osd/transactional-osd.ae
similarity index 100%
rename from code/src/transactional-osd/transactional-osd.ae
rename to code/sandbox/tosd/transactional-osd/transactional-osd.ae
diff --git a/code/src/transactional-osd/transactional-osd.hae b/code/sandbox/tosd/transactional-osd/transactional-osd.hae
similarity index 100%
rename from code/src/transactional-osd/transactional-osd.hae
rename to code/sandbox/tosd/transactional-osd/transactional-osd.hae
diff --git a/code/src/replicated-osd/rosd-create.ae b/code/src/replicated-osd/rosd-create.ae
index 2971684..9915a29 100644
--- a/code/src/replicated-osd/rosd-create.ae
+++ b/code/src/replicated-osd/rosd-create.ae
@@ -14,7 +14,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/* Mercury RPC structures for rosd_create */
@@ -264,7 +263,8 @@ static __blocking triton_ret_t rosd_create_local_storage(
self = triton_self_node();
- tret = tosd_create(oid, niid);
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME tret = tosd_create(oid, niid); */
if(triton_error_equal(tret, TRITON_ERR_NIID_DONE))
{
/* this operation is already done */
@@ -286,15 +286,19 @@ static __blocking triton_ret_t rosd_create_local_storage(
* There is no harm in writing the replication factor twice. We do need
* to look out for conflicts on the transaction number, though.
*/
+ /* TODO: REPLACEME
tret = tosd_write(oid, REP_FACTOR_FORK, 1, buffer_offsets,
&size, 1, &obj_offset, &size, 1, TOSD_FLAG_AUTO_TXN, 0, NULL);
+ */
if(tret != TRITON_SUCCESS)
{
/* We created the object but weren't able to write its metadata.
* Give a best effort here to remove the object in order to simplify
* cleanup later. It's ok if this does not succeed.
*/
+ /* TODO: REPLACEME
tret_tmp = tosd_remove(oid, 0);
+ */
if(tret_tmp != TRITON_SUCCESS)
{
triton_error_destroy(tret_tmp);
diff --git a/code/src/replicated-osd/rosd-probe-fork.ae b/code/src/replicated-osd/rosd-probe-fork.ae
index 33f5d08..eab94f0 100644
--- a/code/src/replicated-osd/rosd-probe-fork.ae
+++ b/code/src/replicated-osd/rosd-probe-fork.ae
@@ -5,7 +5,6 @@
#include "src/common/triton-error.h"
#include "src/replicated-osd/rosd.hae"
#include "src/replicated-osd/rosd-internal.hae"
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
@@ -58,8 +57,11 @@ static __blocking triton_ret_t triton_rpc_rosd_probe_fork(hg_handle_t handle)
assert(out.rrecord && out.rversion && out.rlen && out.rcount);
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_probe_fork(in.oid, in.fork, &out.next, &out.count,
out.rrecord, out.rversion, out.rlen, out.rcount);
+ */
out.tret = triton_error_dup(tret);
diff --git a/code/src/replicated-osd/rosd-probe-object.ae b/code/src/replicated-osd/rosd-probe-object.ae
index d52bf1b..c6b07b6 100644
--- a/code/src/replicated-osd/rosd-probe-object.ae
+++ b/code/src/replicated-osd/rosd-probe-object.ae
@@ -5,7 +5,6 @@
#include "src/common/triton-error.h"
#include "src/replicated-osd/rosd.hae"
#include "src/replicated-osd/rosd-internal.hae"
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
@@ -46,8 +45,11 @@ static __blocking triton_ret_t triton_rpc_rosd_probe_object(hg_handle_t handle)
assert(out.ffork && out.flen && out.fcount);
+ out.tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
out.tret = tosd_probe_object(in.oid, in.fork, &out.next, &out.count,
out.ffork, out.flen, out.fcount);
+ */
triton_mercury_respond(handle, &out);
diff --git a/code/src/replicated-osd/rosd-range.ae b/code/src/replicated-osd/rosd-range.ae
index 851719f..717a19c 100644
--- a/code/src/replicated-osd/rosd-range.ae
+++ b/code/src/replicated-osd/rosd-range.ae
@@ -14,7 +14,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/* Mercury RPC structures for rosd_range */
MERCURY_GEN_PROC(triton_rpc_rosd_range_in_t,
@@ -58,7 +57,10 @@ static __blocking triton_ret_t triton_rpc_rosd_range(hg_handle_t handle)
if(!triton_is_error(out.tret))
{
+ out.tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
out.tret = tosd_range(in.lower, in.upper, out.oid_array, in.count, &out_count, &out.next_position);
+ */
}
assert(out_count >= 0);
out.oid_array_count = out_count;
diff --git a/code/src/replicated-osd/rosd-read.ae b/code/src/replicated-osd/rosd-read.ae
index 3f414d6..0eebcc9 100644
--- a/code/src/replicated-osd/rosd-read.ae
+++ b/code/src/replicated-osd/rosd-read.ae
@@ -17,7 +17,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/* this is the number of concurrent buffers/transfers that the ROSD will
* keep in flight for a single read operation
@@ -119,6 +118,8 @@ static __blocking triton_ret_t rosd_read_xfer_one_buffer(
hg_bulk_t bulk_handle = HG_BULK_NULL;
int ret;
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_read_versioned(
oid,
fork,
@@ -131,6 +132,7 @@ static __blocking triton_ret_t rosd_read_xfer_one_buffer(
out_size,
0,
txn_number);
+ */
if(triton_is_error(tret))
{
diff --git a/code/src/replicated-osd/rosd-remove.ae b/code/src/replicated-osd/rosd-remove.ae
index 9b850e1..8999847 100644
--- a/code/src/replicated-osd/rosd-remove.ae
+++ b/code/src/replicated-osd/rosd-remove.ae
@@ -14,7 +14,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/*
* Mercury RPC structures for rosd_remove
@@ -119,6 +118,8 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
mem_sizes[0] = sizeof(replication_factor);
obj_sizes[0] = sizeof(replication_factor);
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_read(in.oid,
REP_FACTOR_FORK,
mem_offsets,
@@ -129,6 +130,7 @@ static __blocking triton_ret_t triton_rpc_rosd_remove(hg_handle_t handle)
1,
&out_size,
0);
+ */
if (triton_is_error(tret))
{
if (triton_error_equal(tret, TRITON_ERR_NOENT))
@@ -290,7 +292,10 @@ __blocking triton_ret_t rosd_remove_local_storage(
triton_ret_t tret;
int value = 0;
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_remove(oid, niid);
+ */
if(triton_error_equal(tret, TRITON_ERR_NIID_DONE))
{
/* this operation is already done */
diff --git a/code/src/replicated-osd/rosd-reset.ae b/code/src/replicated-osd/rosd-reset.ae
index 01d32bd..85df2a0 100644
--- a/code/src/replicated-osd/rosd-reset.ae
+++ b/code/src/replicated-osd/rosd-reset.ae
@@ -5,7 +5,6 @@
#include "src/common/triton-error.h"
#include "src/replicated-osd/rosd.hae"
#include "src/replicated-osd/rosd-internal.hae"
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
@@ -119,6 +118,8 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
pbranch
{
// modify local records
+ l_tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
l_tret = tosd_reset_record(in.oid,
in.fork,
in.record,
@@ -128,6 +129,7 @@ static __blocking triton_ret_t triton_rpc_rosd_reset(hg_handle_t handle)
in.condition,
&out.reset_count,
niid);
+ */
}
}
}
diff --git a/code/src/replicated-osd/rosd-txn-nr-cache.ae b/code/src/replicated-osd/rosd-txn-nr-cache.ae
index 88be691..910b383 100644
--- a/code/src/replicated-osd/rosd-txn-nr-cache.ae
+++ b/code/src/replicated-osd/rosd-txn-nr-cache.ae
@@ -9,7 +9,6 @@
#include <triton-hash.h>
#include "src/common/triton-debug.h"
#include "rosd-txn-nr-cache.hae"
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/replicated-osd/rosd.hae"
static TRITON_LIST_DEFINE(lru_list);
@@ -129,7 +128,10 @@ __blocking triton_ret_t txn_nr_cache_get(struct txn_nr_cache_entry **entry, uint
tmp_entry->oid = oid;
tmp_entry->ref_count = 1;
/* pull current txn_number from tosd */
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_get_version(oid, &tmp_entry->txn_number);
+ */
if(tret != TRITON_SUCCESS)
{
triton_mutex_unlock(&txn_nr_mutex);
diff --git a/code/src/replicated-osd/rosd-util.ae b/code/src/replicated-osd/rosd-util.ae
index 9090eb8..8f0628c 100644
--- a/code/src/replicated-osd/rosd-util.ae
+++ b/code/src/replicated-osd/rosd-util.ae
@@ -1,4 +1,3 @@
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/replicated-osd/rosd-internal.hae"
__blocking triton_ret_t rosd_get_replication_factor (uint128_t oid,
@@ -17,6 +16,8 @@ __blocking triton_ret_t rosd_get_replication_factor (uint128_t oid,
mem_sizes[0] = sizeof(replication_factor);
obj_sizes[0] = sizeof(replication_factor);
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_read(oid,
REP_FACTOR_FORK,
mem_offsets,
@@ -27,6 +28,7 @@ __blocking triton_ret_t rosd_get_replication_factor (uint128_t oid,
1,
&out_size,
0);
+ */
if (tret == TRITON_SUCCESS)
{
if (out_size == 0)
diff --git a/code/src/replicated-osd/rosd-write.ae b/code/src/replicated-osd/rosd-write.ae
index 1bf7f28..14af635 100644
--- a/code/src/replicated-osd/rosd-write.ae
+++ b/code/src/replicated-osd/rosd-write.ae
@@ -16,7 +16,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/* this is the number of concurrent buffers/transfers that the ROSD will
* keep in flight for a single write operation
@@ -361,8 +360,11 @@ static __blocking triton_ret_t triton_rpc_rosd_write(hg_handle_t handle)
obj_offset = 0;
buffer_offsets[0] = (char*)&in.replication_factor;
size = sizeof(in.replication_factor);
+ out.tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
out.tret = tosd_read(in.oid, REP_FACTOR_FORK, buffer_offsets,
&size, 1, &obj_offset, &size, 1, &out_size, 0);
+ */
if(triton_is_error(out.tret))
{
triton_error_msg("tosd_read() failure for replication factor\n");
@@ -599,18 +601,23 @@ static __blocking triton_ret_t rosd_write_local_storage(
uint64_t niid = 0;
int value = 0;
char* buffer_offsets[1];
- int tosd_flags = TOSD_FLAG_AUTO_TXN;
triton_node_t self;
+ /* TODO: REPLACEME
+ int tosd_flags = TOSD_FLAG_AUTO_TXN;
if(flags & ROSD_FLAG_TRUNC_WRITE)
tosd_flags |= TOSD_FLAG_TRUNC_WRITE;
+ */
/* NOTE: a typical write is idempotent; no need for niid information
* here
*/
buffer_offsets[0] = buffer;
+ tret = TRITON_ERR_NOT_IMPLEMENTED;
+ /* TODO: REPLACEME
tret = tosd_write(oid, oid_fork, txn_number, buffer_offsets, &size,
1, &offset, &size, 1, tosd_flags, 0, NULL);
+ */
if(triton_is_error(tret))
{
triton_error_msg("tosd_write() failure.\n");
diff --git a/code/src/replicated-osd/rosd.ae b/code/src/replicated-osd/rosd.ae
index c6e892f..b2f3da4 100644
--- a/code/src/replicated-osd/rosd.ae
+++ b/code/src/replicated-osd/rosd.ae
@@ -18,7 +18,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/zeroconf/zeroconf.h"
static triton_mutex_t module_lock = TRITON_MUTEX_INITIALIZER;
@@ -190,6 +189,9 @@ triton_ret_t asg_oid_to_addrs(uint64_t oid, uint32_t replication_factor, int* my
return(triton_oid_to_addrs(tmp_oid, replication_factor, my_position, addr_array));
}
+/* a 64-bit version of triton_oid_to_addrs. Once the ROSD interfaces are
+ * rewritten, we should replace it with this function */
+
/* checks system state and runs placement to identify addresses responsible
* for a given oid.
*
diff --git a/code/src/replicated-osd/rsos-read.ae b/code/src/replicated-osd/rsos-read.ae
index a828365..b5c8464 100644
--- a/code/src/replicated-osd/rsos-read.ae
+++ b/code/src/replicated-osd/rsos-read.ae
@@ -17,7 +17,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/* this is the number of concurrent buffers/transfers that the ROSD will
* keep in flight for a single read operation
diff --git a/code/src/replicated-osd/rsos-write.ae b/code/src/replicated-osd/rsos-write.ae
index d78bf53..98b6580 100644
--- a/code/src/replicated-osd/rsos-write.ae
+++ b/code/src/replicated-osd/rsos-write.ae
@@ -17,7 +17,6 @@
#include "src/remote/mercury-engine.hae"
#include "src/remote/mercury-encode.h"
#include "src/system-state/system-state.hae"
-#include "src/transactional-osd/transactional-osd.hae"
/* this is the number of concurrent buffers/transfers that the ROSD will
* keep in flight for a single write operation
diff --git a/code/src/server/triton-server.ae b/code/src/server/triton-server.ae
index 023fff9..3f133f3 100644
--- a/code/src/server/triton-server.ae
+++ b/code/src/server/triton-server.ae
@@ -18,7 +18,6 @@
#include "src/system-state/system-state.hae"
#include "src/system-state/system-state-engine.hae"
#include "src/replicated-osd/rosd.hae"
-#include "src/transactional-osd/transactional-osd.hae"
#include "src/placement/placement.h"
static triton_ret_t make_daemon(void);
@@ -175,6 +174,7 @@ __blocking int aesop_main(int argc, char **argv)
triton_info_msg("Server starting\n");
/* set up local storage */
+ /* TODO: REPLACEME
tret = tosd_init();
if(triton_is_error(tret))
{
@@ -184,13 +184,14 @@ __blocking int aesop_main(int argc, char **argv)
triton_debug_finalize();
return(-1);
}
+ */
/* TODO: better encapsulate this */
sos_path = triton_zeroconf_get("triton_sos_base_path");
if (sos_path == NULL){
triton_error_msg("config variable triton_sos_base_path "
"not present, exiting...\n");
- tosd_finalize();
+ /* tosd_finalize(); */
triton_place_finalize();
triton_debug_finalize();
return(-1);
@@ -199,7 +200,7 @@ __blocking int aesop_main(int argc, char **argv)
if(ret != 0)
{
triton_error_msg_ret(tret, "sos_init()");
- tosd_finalize();
+ /*tosd_finalize();*/
triton_place_finalize();
triton_debug_finalize();
return(-1);
@@ -234,7 +235,7 @@ __blocking int aesop_main(int argc, char **argv)
triton_error_msg_ret(tret, "triton_rosd_svr_init()");
triton_error_destroy(tret);
sos_fini(sos_ctx);
- tosd_finalize();
+ /*tosd_finalize();*/
triton_place_finalize();
triton_debug_finalize();
#if 0
@@ -252,7 +253,7 @@ __blocking int aesop_main(int argc, char **argv)
triton_error_destroy(tret);
triton_rosd_svr_finalize();
sos_fini(sos_ctx);
- tosd_finalize();
+ /*tosd_finalize();*/
#if 0
triton_signal_finalize();
#endif
@@ -270,7 +271,7 @@ __blocking int aesop_main(int argc, char **argv)
triton_mercury_engine_finalize();
triton_rosd_svr_finalize();
sos_fini(sos_ctx);
- tosd_finalize();
+ /*tosd_finalize();*/
#if 0
triton_signal_finalize();
#endif
@@ -342,7 +343,7 @@ __blocking int aesop_main(int argc, char **argv)
triton_rosd_svr_finalize();
sos_fini(sos_ctx);
- tosd_finalize();
+ /*tosd_finalize();*/
triton_core_rpc_finalize();
triton_mercury_engine_finalize();
#if 0
diff --git a/code/tests/Makefile.subdir b/code/tests/Makefile.subdir
index 1e57ca7..e5e594e 100644
--- a/code/tests/Makefile.subdir
+++ b/code/tests/Makefile.subdir
@@ -7,9 +7,6 @@ XFAIL_TESTS += \
endif
check_PROGRAMS += \
- tests/transactional-osd/tosd1 \
- tests/transactional-osd/tosd-bench-create \
- tests/transactional-osd/bdb-snapshot-write \
tests/replicated-osd/buffer-mgmt-test \
tests/common/test-triton-ret-t \
tests/common/test-debug \
@@ -18,10 +15,12 @@ check_PROGRAMS += \
tests/asg/test-asg-simple \
tests/asg/test-asg-simple-sos
+#TODO: REPLACEME
+#tests/transactional-osd/tosd1
+#tests/transactional-osd/tosd-bench-create
+#tests/transactional-osd/bdb-snapshot-write
+
TESTS += \
- tests/transactional-osd/tosd1 \
- tests/transactional-osd/tosd-bench-create.sh \
- tests/transactional-osd/bdb-snapshot-write.sh \
tests/replicated-osd/buffer-mgmt-test \
tests/triton-noop.sh \
tests/triton-noop-multi-svr.sh \
@@ -40,28 +39,33 @@ TESTS += \
tests/placement/test-placement-mrh.sh \
tests/common/test-debug.sh \
tests/system-state/test-system-state \
- tests/asg/test-asg-simple.sh \
- tests/asg/test-asg-simple-sos.sh
+ tests/asg/test-asg-simple.sh
+
+#TODO: REPLACEME
+#tests/transactional-osd/tosd1
+#tests/transactional-osd/tosd-bench-create.sh
+#tests/transactional-osd/bdb-snapshot-write.sh
+
+#tests/asg/test-asg-simple-sos.sh
AE_SRC += tests/placement/test-placement.ae \
- tests/transactional-osd/tosd-bench-create.ae \
- tests/transactional-osd/tosd1.ae \
tests/replicated-osd/buffer-mgmt-test.ae \
tests/system-state/test-system-state.ae
+#tests/transactional-osd/tosd-bench-create.ae
+#tests/transactional-osd/tosd1.ae
+
# override default sources for test programs written in c
tests_common_test_triton_ret_t_SOURCES = tests/common/test-triton-ret-t.c
tests_common_test_debug_SOURCES = tests/common/test-debug.c
tests_asg_test_asg_simple_SOURCES = tests/asg/test-asg-simple.c
tests_asg_test_asg_simple_sos_SOURCES = tests/asg/test-asg-simple-sos.c
-tests_transactional_osd_bdb_snapshot_write_SOURCES = tests/transactional-osd/bdb-snapshot-write.c
+#tests_transactional_osd_bdb_snapshot_write_SOURCES = tests/transactional-osd/bdb-snapshot-write.c
EXTRA_DIST += \
tests/triton-show-debug-masks.sh \
tests/triton-cp-big.sh \
tests/triton-show-placement.sh \
- tests/transactional-osd/tosd-bench-create.sh \
- tests/transactional-osd/bdb-snapshot-write.sh \
tests/test-util.sh \
tests/triton-noop.sh \
tests/triton-rm.sh \
@@ -77,4 +81,6 @@ EXTRA_DIST += \
tests/triton-ls.sh \
tests/triton-noop-multi-svr.sh \
tests/triton-show-system-state.sh
-
+
+#tests/transactional-osd/tosd-bench-create.sh
+#tests/transactional-osd/bdb-snapshot-write.sh
hooks/post-receive
--
1
0
branch, trac-323-sos, updated. 76f4eb5953c0ee4ab8f7132fe71c0b4b7703ca42
by noreply@mcs.anl.gov 19 Dec '14
by noreply@mcs.anl.gov 19 Dec '14
19 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, trac-323-sos has been updated
via 76f4eb5953c0ee4ab8f7132fe71c0b4b7703ca42 (commit)
via daaca70ca67d57e10fb6a8625992096b7966e4b3 (commit)
via 7e4da252fed06726f410fa72892b86f24a41a695 (commit)
from fec6d18cd2488ba730e707479b959f219dfce46d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 76f4eb5953c0ee4ab8f7132fe71c0b4b7703ca42
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 11:01:57 2014 -0600
change auto-config node id gen. to 64-bit
commit daaca70ca67d57e10fb6a8625992096b7966e4b3
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Fri Dec 19 10:51:11 2014 -0600
removed 128-bit id usage in placement
There's still some usage in the code for patching up the placement test program
and for pretty-printing OIDs. These can be removed at some point.
commit 7e4da252fed06726f410fa72892b86f24a41a695
Author: John Jenkins <jenkins(a)mcs.anl.gov>
Date: Thu Dec 18 15:58:23 2014 -0600
rework multi-ring addr space, use only bottom uint128 bits
Object address space is now partitioned among the rings as opposed to the
previous modulo approach (oid 0 -> ring 0, oid 1 -> ring 1, etc.).
Soon the use of uint128 will be removed entirely from the placement code.
-----------------------------------------------------------------------
Summary of changes:
code/scripts/simple-mgmt/make_node_ids.py | 8 +-
code/src/admin-tools/triton-show-placement.ae | 2 +-
code/src/placement/placement-1d.c | 47 +++++------
code/src/placement/placement-method.h | 2 +-
code/src/placement/placement-multiring.c | 111 ++++++++++++++-----------
code/src/placement/placement.ae | 4 +-
code/src/placement/placement.h | 4 +-
code/src/replicated-osd/rosd.ae | 2 +-
code/tests/placement/test-placement.ae | 18 +++--
9 files changed, 107 insertions(+), 91 deletions(-)
Diff of changes:
diff --git a/code/scripts/simple-mgmt/make_node_ids.py b/code/scripts/simple-mgmt/make_node_ids.py
index e2072f6..e9216c6 100755
--- a/code/scripts/simple-mgmt/make_node_ids.py
+++ b/code/scripts/simple-mgmt/make_node_ids.py
@@ -5,7 +5,7 @@ from socket import inet_ntop, AF_INET6
from struct import pack
IPv6_BYTES = 16
-BYTES = 16 # set lower for testing
+BYTES = 8 # set lower for testing
ID_MAX = 2**(8*BYTES)
def usage():
@@ -13,16 +13,16 @@ def usage():
"Usage: make_node_ids.py [-d] N\n"\
" -d - print as integers rather than IPv6 strings\n"\
" N - number of nodes\n"\
-"Generates N evenly spaced node-IDs in a 128-bit address space. Prints out\n"\
+"Generates N evenly spaced node-IDs in a 64-bit address space. Prints out\n"\
"in IPv6 format to comply with triton configuration file requirements.\n\n"\
"NOTE: currently assumes little-endian (uses struct.pack and bit-shifting).\n"
" Not sure whether the code will hold for big-endian systems\n\n"
"NOTE: doesn't 'perfectly' spread them out - the last server will contain the\n"\
" remainder between the max ID and N so that there's no rollover on\n"
-" server 1, which shouldn't matter with a 2**128 address space.\n")
+" server 1, which shouldn't matter with a 2**64 address space.\n")
def printIPv6(n):
- # first create a packed string with padded 0's
+ # first create a packed string with padded 0's
bytearr = []
B = IPv6_BYTES
for i in range(0, B):
diff --git a/code/src/admin-tools/triton-show-placement.ae b/code/src/admin-tools/triton-show-placement.ae
index bfe33b5..d60f711 100644
--- a/code/src/admin-tools/triton-show-placement.ae
+++ b/code/src/admin-tools/triton-show-placement.ae
@@ -51,7 +51,7 @@ __blocking int aesop_main(int argc, char **argv)
oid = triton_uint128_from_string(argv[2]);
- tret = triton_place_lookup_dump(oid, closest, 3);
+ tret = triton_place_lookup_dump(oid.l, closest, 3);
if(triton_is_error(tret))
{
triton_error_print(tret, "triton_place_lookup_dump()");
diff --git a/code/src/placement/placement-1d.c b/code/src/placement/placement-1d.c
index 92ad41b..8dda421 100644
--- a/code/src/placement/placement-1d.c
+++ b/code/src/placement/placement-1d.c
@@ -10,7 +10,7 @@
#include "src/placement/placement-method.h"
static triton_ret_t lookup_1d_euclid(
- uint128_t oid,
+ uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count,
int dump_flag);
@@ -33,6 +33,7 @@ struct triton_placement_method triton_placement_1d =
struct node_1d
{
triton_node_t node_id;
+ uint64_t id;
int idx;
};
@@ -40,7 +41,7 @@ static struct node_1d * g_node_array = NULL;
static int g_node_array_size = 0;
static triton_ret_t lookup_1d_euclid(
- uint128_t oid,
+ uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count,
int dump_flag)
@@ -71,7 +72,7 @@ static triton_ret_t lookup_1d_euclid(
* after it, but the search logic is easier this way and we can easily
* step forward from here)
*/
- immed_counter_clockwise = bsearch(&oid, g_node_array, g_node_array_size,
+ immed_counter_clockwise = bsearch(&oid, g_node_array, g_node_array_size,
sizeof(*g_node_array), nearest_cmp);
if(!immed_counter_clockwise)
{
@@ -89,8 +90,10 @@ static triton_ret_t lookup_1d_euclid(
((immed_counter_clockwise->idx+1+i)%g_node_array_size)].node_id;
if(dump_flag)
{
+ uint128_t oid_l;
+ oid_l.u = 0; oid_l.l = oid;
id_str = triton_uint128_to_string(closest_nodes[i]);
- id_str2 = triton_uint128_to_string(oid);
+ id_str2 = triton_uint128_to_string(oid_l);
printf("# oid %s mapped %d replica to node %s\n", id_str2, i, id_str);
if(id_str) free(id_str);
if(id_str2) free(id_str2);
@@ -120,6 +123,7 @@ static triton_ret_t initialize_1d(
for(i=0; i<initial_node_array_size; i++)
{
g_node_array[i].node_id = initial_node_array[i];
+ g_node_array[i].id = initial_node_array[i].l;
g_node_array[i].idx = i;
}
g_node_array_size = initial_node_array_size;
@@ -141,38 +145,33 @@ static void finalize_1d(void)
static int triton_node_1d_cmp(const void* a, const void* b)
{
- const struct node_1d* n_a = a;
- const struct node_1d* n_b = b;
-
- return(triton_cmp_uint128(n_a->node_id, n_b->node_id));
+ uint64_t aa = *(const uint64_t*)a;
+ uint64_t bb = *(const uint64_t*)b;
+ if (aa < bb) return -1;
+ else if (aa == bb) return 0;
+ else return 1;
}
/* find the server with the largest ID less than the object ID */
static int nearest_cmp(const void* key, const void *member)
{
- const uint128_t* obj = key;
const struct node_1d* svr = member;
- int cmp;
-
- cmp = triton_cmp_uint128(*obj, svr->node_id);
-
- /* server id is greater than object ID */
- if(cmp < 0)
- return(-1);
-
- /* object ID is greater than server ID */
- if(cmp > 0)
+ const uint64_t oid = *(const uint64_t*) key;
+ int cmp = triton_node_1d_cmp(key, member);
+ if (cmp < 0)
+ return -1;
+ else if (cmp > 0)
{
/* are we on the last server already? */
- if(svr->idx == (g_node_array_size-1))
- return(0);
+ if (svr->idx == (g_node_array_size-1))
+ return 0;
/* is the oid also larger than the next server's id? */
- if(triton_cmp_uint128(*obj, g_node_array[svr->idx+1].node_id) > 0)
- return(1);
+ else if (oid > g_node_array[svr->idx+1].id)
+ return 1;
}
/* otherwise it is in our range */
- return(0);
+ return 0;
}
/*
diff --git a/code/src/placement/placement-method.h b/code/src/placement/placement-method.h
index 5241768..3a585da 100644
--- a/code/src/placement/placement-method.h
+++ b/code/src/placement/placement-method.h
@@ -8,7 +8,7 @@ struct triton_placement_method
{
const char* name;
triton_ret_t (*lookup)(
- uint128_t oid,
+ uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count,
int dump_flag);
diff --git a/code/src/placement/placement-multiring.c b/code/src/placement/placement-multiring.c
index 8fdedcc..8e9d45b 100644
--- a/code/src/placement/placement-multiring.c
+++ b/code/src/placement/placement-multiring.c
@@ -11,7 +11,7 @@
#include "src/placement/placement-method.h"
static triton_ret_t lookup_mring(
- uint128_t oid,
+ uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count,
int dump_flag);
@@ -35,7 +35,7 @@ struct node_mrh
{
triton_node_t node_id;
int idx;
- triton_node_t virt_id;
+ uint64_t virt_id;
int ring;
};
@@ -45,15 +45,16 @@ struct node_mrh
static struct node_mrh **g_rings = NULL;
static int g_num_rings = 0;
static int g_num_servers = 0;
+static uint64_t g_oids_per_ring = 0;
static triton_ret_t lookup_mring(
- uint128_t oid,
+ uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count,
int dump_flag)
{
int ring;
- uint64_t tmp;
+ uint64_t oid_search;
struct node_mrh* immed_counter_clockwise = NULL;
int i, j;
char* id_str;
@@ -73,7 +74,10 @@ static triton_ret_t lookup_mring(
for(j=0; j<g_num_servers; j++)
{
id_str = triton_uint128_to_string(g_rings[i][j].node_id);
- id_str2 = triton_uint128_to_string(g_rings[i][j].virt_id);
+ uint128_t oid2;
+ oid2.l = g_rings[i][j].virt_id;
+ oid2.u = 0;
+ id_str2 = triton_uint128_to_string(oid2);
printf("# idx:%d node_id:%s, virt_id:%s\n", j, id_str, id_str2);
if(id_str) free(id_str);
if(id_str2) free(id_str2);
@@ -81,16 +85,24 @@ static triton_ret_t lookup_mring(
}
}
- /* TODO: what's the best way to map oids to rings? We need to take both
- * the upper and lower bits into account. This would be easier if
- * object ids and server ids were 64 bits.
- */
- tmp = oid.u + oid.l;
- ring = tmp % g_num_rings;
+ ring = oid / g_oids_per_ring;
+ assert(ring <= g_oids_per_ring);
+ /* account for extra oids in last ring */
+ if (ring == g_oids_per_ring){
+ ring--;
+ oid_search = oid - (g_oids_per_ring * (g_num_rings-1));
+ }
+ else {
+ oid_search = oid % g_oids_per_ring;
+ }
+
if(dump_flag)
{
- id_str = triton_uint128_to_string(oid);
- printf("# oid %s mapped to ring %d\n", id_str, ring);
+ uint128_t tmp;
+ tmp.u = 0;
+ tmp.l = oid;
+ id_str = triton_uint128_to_string(tmp);
+ printf("# oid %s mapped to ring %d\n", id_str, ring);
if(id_str)
free(id_str);
}
@@ -100,7 +112,8 @@ static triton_ret_t lookup_mring(
* after it, but the search logic is easier this way and we can easily
* step forward from here)
*/
- immed_counter_clockwise = bsearch(&oid, g_rings[ring], g_num_servers,
+
+ immed_counter_clockwise = bsearch(&oid_search, g_rings[ring], g_num_servers,
sizeof(**g_rings), nearest_cmp);
if(!immed_counter_clockwise)
{
@@ -119,8 +132,10 @@ static triton_ret_t lookup_mring(
if(dump_flag)
{
id_str = triton_uint128_to_string(closest_nodes[i]);
- id_str2 = triton_uint128_to_string(oid);
- printf("# oid %s mapped %d replica to node %s\n", id_str2, i, id_str);
+ uint128_t oid2;
+ oid2.u = 0; oid2.l = oid;
+ id_str2 = triton_uint128_to_string(oid2);
+ printf("# oid %s mapped %d replica to node %s\n", id_str2, i, id_str);
if(id_str) free(id_str);
if(id_str2) free(id_str2);
}
@@ -138,6 +153,7 @@ static triton_ret_t initialize_mring(
int i;
int j;
uint32_t h1, h2;
+ uint64_t oids_leftover;
assert(initial_node_array);
assert(initial_node_array_size > 0);
@@ -172,26 +188,25 @@ static triton_ret_t initialize_mring(
}
}
+ g_oids_per_ring = UINT64_MAX / (uint64_t) g_num_rings;
+ oids_leftover = UINT64_MAX % (uint64_t) g_num_rings;
+
for(i=0; i<g_num_servers; i++)
{
for(j=0; j<g_num_rings; j++)
{
+ uint64_t hash;
g_rings[j][i].node_id = initial_node_array[i];
/* generate virtual id based on hash of node_id with ring number
- * as seed. Two hashes needed here to generate upper and lower
- * bits of 128 bit id.
- */
+ * as seed. */
h1 = j;
h2 = 0;
- bj_hashlittle2(&initial_node_array[i],
- sizeof(initial_node_array[i]), &h1, &h2);
- g_rings[j][i].virt_id.u = h1 + (((uint64_t)h2)<<32);
- h1 = j;
- h2 = 1;
- bj_hashlittle2(&initial_node_array[i],
+ bj_hashlittle2(&initial_node_array[i],
sizeof(initial_node_array[i]), &h1, &h2);
- g_rings[j][i].virt_id.l = h1 + (((uint64_t)h2)<<32);
+ hash = h1 + (((uint64_t)h2)<<32);
+ g_rings[j][i].virt_id = hash %
+ (g_oids_per_ring + ((j==g_num_rings-1) ? oids_leftover : 0));
}
}
@@ -206,7 +221,7 @@ static triton_ret_t initialize_mring(
g_rings[i][j].idx = j;
}
}
-
+
return(TRITON_SUCCESS);
}
@@ -224,40 +239,38 @@ static void finalize_mring(void)
return;
}
+/* NOTE: currently zeroing out upper bits for comparison until we remove
+ * 128-bit ids */
static int triton_node_mring_cmp(const void* a, const void* b)
{
- const struct node_mrh* n_a = a;
- const struct node_mrh* n_b = b;
-
- return(triton_cmp_uint128(n_a->virt_id, n_b->virt_id));
+ uint64_t aa = *(const uint64_t*)a;
+ uint64_t bb = *(const uint64_t*)b;
+ if (aa < bb) return -1;
+ else if (aa == bb) return 0;
+ else return 1;
}
-/* find the server with the largest virtual ID less than the object ID */
+/* find the server with the largest virtual ID less than the object ID
+ * NOTE: currently zeroing out upper bits for comparison until we remove
+ * 128-bit ids */
static int nearest_cmp(const void* key, const void *member)
{
- const uint128_t* obj = key;
const struct node_mrh* svr = member;
- int cmp;
-
- cmp = triton_cmp_uint128(*obj, svr->virt_id);
-
- /* server id is greater than object ID */
- if(cmp < 0)
- return(-1);
-
- /* object ID is greater than server ID */
- if(cmp > 0)
- {
+ const uint64_t oid = *(const uint64_t*) key;
+ int cmp = triton_node_mring_cmp(key, member);
+ if (cmp < 0)
+ return -1;
+ else if (cmp > 0){
/* are we on the last server already? */
- if(svr->idx == (g_num_servers-1))
- return(0);
+ if (svr->idx == (g_num_servers-1))
+ return 0;
/* is the oid also larger than the next server's id? */
- if(triton_cmp_uint128(*obj, g_rings[svr->ring][svr->idx+1].virt_id) > 0)
- return(1);
+ else if (oid > g_rings[svr->ring][svr->idx+1].virt_id)
+ return 1;
}
/* otherwise it is in our range */
- return(0);
+ return 0;
}
diff --git a/code/src/placement/placement.ae b/code/src/placement/placement.ae
index 641dad3..6f77b99 100644
--- a/code/src/placement/placement.ae
+++ b/code/src/placement/placement.ae
@@ -24,7 +24,7 @@ static int module_refcount = 0;
static char* g_placement_method = NULL;
static char* g_placement_params = NULL;
-triton_ret_t triton_place_lookup(uint128_t oid,
+triton_ret_t triton_place_lookup(uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count)
{
@@ -32,7 +32,7 @@ triton_ret_t triton_place_lookup(uint128_t oid,
closest_nodes, closest_nodes_count, 0));
}
-triton_ret_t triton_place_lookup_dump(uint128_t oid,
+triton_ret_t triton_place_lookup_dump(uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count)
{
diff --git a/code/src/placement/placement.h b/code/src/placement/placement.h
index 6cab49e..205f4cf 100644
--- a/code/src/placement/placement.h
+++ b/code/src/placement/placement.h
@@ -6,11 +6,11 @@
triton_ret_t triton_place_initialize(void);
-triton_ret_t triton_place_lookup(uint128_t oid,
+triton_ret_t triton_place_lookup(uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count);
-triton_ret_t triton_place_lookup_dump(uint128_t oid,
+triton_ret_t triton_place_lookup_dump(uint64_t oid,
triton_node_t* closest_nodes,
int closest_nodes_count);
diff --git a/code/src/replicated-osd/rosd.ae b/code/src/replicated-osd/rosd.ae
index 5279550..c6e892f 100644
--- a/code/src/replicated-osd/rosd.ae
+++ b/code/src/replicated-osd/rosd.ae
@@ -221,7 +221,7 @@ triton_ret_t triton_oid_to_addrs(uint128_t oid, uint32_t replication_factor, int
* the array to only include nodes that are valid targets.
*/
- tret = triton_place_lookup(oid, target_nodes, replication_factor);
+ tret = triton_place_lookup(oid.l, target_nodes, replication_factor);
if(triton_is_error(tret))
{
free(target_nodes);
diff --git a/code/tests/placement/test-placement.ae b/code/tests/placement/test-placement.ae
index 5f8141d..caf9d95 100644
--- a/code/tests/placement/test-placement.ae
+++ b/code/tests/placement/test-placement.ae
@@ -9,7 +9,8 @@ __blocking int aesop_main(int argc, char **argv)
triton_ret_t tret;
triton_node_t servers[4];
triton_node_t closest[3];
- uint128_t oid;
+ uint128_t oid_l;
+ uint64_t oid;
int i;
char *id_str;
char dummy_system_state[4096];
@@ -64,8 +65,10 @@ __blocking int aesop_main(int argc, char **argv)
/*****************/
- oid = servers[2];
- oid.l -= 3;
+ oid = servers[2].l;
+ oid -= 3;
+ oid_l.l = oid;
+ oid_l.u = 0;
tret = triton_place_lookup(oid, closest, 3);
if(triton_is_error(tret))
@@ -82,7 +85,7 @@ __blocking int aesop_main(int argc, char **argv)
printf("\t%s\n", id_str);
if (id_str) free(id_str);
}
- id_str = triton_uint128_to_string(oid);
+ id_str = triton_uint128_to_string(oid_l);
printf("closest to OID: %s:\n", id_str);
if (id_str) free(id_str);
for(i=0; i<3; i++)
@@ -95,8 +98,9 @@ __blocking int aesop_main(int argc, char **argv)
/*****************/
- oid = servers[3];
- oid.l -= 3;
+ oid = servers[3].l;
+ oid -= 3;
+ oid_l.l = oid;
tret = triton_place_lookup(oid, closest, 3);
if(triton_is_error(tret))
@@ -113,7 +117,7 @@ __blocking int aesop_main(int argc, char **argv)
printf("\t%s\n", id_str);
if (id_str) free(id_str);
}
- id_str = triton_uint128_to_string(oid);
+ id_str = triton_uint128_to_string(oid_l);
printf("closest to OID: %s:\n", id_str);
if (id_str) free(id_str);
for(i=0; i<3; i++)
hooks/post-receive
--
1
0
18 Dec '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 114c572a7d5a6eb7472d5f5c303485e742138fde (commit)
from 8e788f643fd75f4caccc4d20d9e312e23170fcbe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 114c572a7d5a6eb7472d5f5c303485e742138fde
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Thu Dec 18 09:45:16 2014 -0500
accept change tracking
-----------------------------------------------------------------------
Summary of changes:
.../2014.12.30/anl-quarterly-report-2014-12.docx | Bin 111196 -> 109768 bytes
1 files changed, 0 insertions(+), 0 deletions(-)
Diff of changes:
diff --git a/reports/triton-quarterly/2014.12.30/anl-quarterly-report-2014-12.docx b/reports/triton-quarterly/2014.12.30/anl-quarterly-report-2014-12.docx
index d18253c..219b807 100644
Binary files a/reports/triton-quarterly/2014.12.30/anl-quarterly-report-2014-12.docx and b/reports/triton-quarterly/2014.12.30/anl-quarterly-report-2014-12.docx differ
hooks/post-receive
--
1
0