├── .gitignore ├── LICENSE ├── Makefile ├── Makefile.inc ├── README.md ├── doc ├── Bugs-Descriptions.pdf ├── Bugs-Descriptions_EN.pdf ├── Install-Linux.md ├── Install-OpenBSD.md ├── Install.md ├── Reproduce-Bugs.md ├── SandTable-Design.pdf └── SandTable-Paper.pdf ├── docker ├── Dockerfile ├── docker-compose.yml └── requirements.txt ├── scripts ├── CommunityModules-deps.jar ├── batch_config_tproxy.sh ├── common │ ├── run_one_testcase_common.sh │ ├── start_docker_common.sh │ ├── system_config_common.sh │ └── wait_tmux_common.sh ├── docker_rsync.sh ├── env.sh ├── generate_config.sh ├── getip.sh ├── spssh.sh ├── tla2tools.jar ├── tlcwrapper.py ├── tproxy.sh └── trace_reader.py ├── src ├── CMakeLists.txt ├── controller │ ├── CMakeLists.txt │ ├── Command.cpp │ ├── Command.h │ ├── ConfigFile.cpp │ ├── ConfigFile.h │ ├── Msg.cpp │ ├── Msg.h │ ├── RemoteControl.cpp │ ├── RemoteControl.h │ ├── Repl.cpp │ ├── Repl.h │ ├── Socket.cpp │ ├── Socket.h │ ├── TcpNetwork.cpp │ ├── TcpNetwork.h │ ├── TcpSocket.cpp │ ├── TcpSocket.h │ ├── UdpNetwork.cpp │ ├── UdpNetwork.h │ ├── UdpSocket.cpp │ ├── UdpSocket.h │ ├── cmake │ │ ├── FindConcurrentQueue.cmake │ │ └── FindReadline.cmake │ ├── common.h │ └── main.cpp └── interceptor │ ├── CMakeLists.txt │ ├── common.c │ ├── common.h │ ├── config.cpp │ ├── config.h │ ├── myaccept.c │ ├── myaccept.h │ ├── myaccept4.c │ ├── myaccept4.h │ ├── myclock_getres.c │ ├── myclock_getres.h │ ├── myclock_gettime.c │ ├── myclock_gettime.h │ ├── myclose.c │ ├── myclose.h │ ├── myconnect.c │ ├── myconnect.h │ ├── mygettimeofday.c │ ├── mygettimeofday.h │ ├── mymallocfree.c │ ├── myopen.c │ ├── myopen.h │ ├── myopenat.c │ ├── myopenat.h │ ├── myrandom.c │ ├── myrandom.h │ ├── myread.c │ ├── myread.h │ ├── myrecv.c │ ├── myrecv.h │ ├── myrecvfrom.c │ ├── myrecvfrom.h │ ├── myrecvmsg.c │ ├── myrecvmsg.h │ ├── mysend.c │ ├── mysend.h │ ├── mysendfile.c │ ├── mysendfile.h │ ├── mysendmmsg.c │ ├── mysendmmsg.h │ ├── mysendmsg.c │ ├── mysendmsg.h │ ├── mysendto.c │ ├── mysendto.h │ ├── mysocket.c │ ├── mysocket.h │ ├── mysyscall.c │ ├── mysyscall.h │ ├── mytime.c │ ├── mytime.h │ ├── mywrite.c │ ├── mywrite.h │ ├── mywritev.c │ ├── mywritev.h │ ├── router.cpp │ ├── router.h │ ├── run.sh │ ├── state_collector.cpp │ ├── state_collector.h │ ├── timing.c │ ├── timing.h │ └── version.map └── systems ├── PySyncObj ├── Makefile ├── bugs │ ├── leader_commits_older_terms │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── PySyncObj.tla │ │ └── pysyncobj │ ├── next_idx_no_greater_than_match_idx │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── PySyncObj.tla │ │ └── pysyncobj │ ├── non_monotonic_commit_idx │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── PySyncObj.tla │ │ └── pysyncobj │ └── non_monotonic_match_idx │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── PySyncObj.tla │ │ └── pysyncobj ├── pysyncobj-v0.3.11-with-pr171 │ ├── README │ └── pysyncobj │ │ ├── __init__.py │ │ ├── atomic_replace.py │ │ ├── batteries.py │ │ ├── config.py │ │ ├── dns_resolver.py │ │ ├── encryptor.py │ │ ├── fast_queue.py │ │ ├── journal.py │ │ ├── monotonic.py │ │ ├── node.py │ │ ├── pickle.py │ │ ├── pipe_notifier.py │ │ ├── poller.py │ │ ├── serializer.py │ │ ├── syncobj.py │ │ ├── syncobj_admin.py │ │ ├── tcp_connection.py │ │ ├── tcp_server.py │ │ ├── transport.py │ │ ├── utility.py │ │ ├── version.py │ │ └── win_inet_pton.py ├── pysyncobj-v0.3.11 │ ├── README │ └── pysyncobj │ │ ├── __init__.py │ │ ├── atomic_replace.py │ │ ├── batteries.py │ │ ├── config.py │ │ ├── dns_resolver.py │ │ ├── encryptor.py │ │ ├── fast_queue.py │ │ ├── journal.py │ │ ├── monotonic.py │ │ ├── node.py │ │ ├── pickle.py │ │ ├── pipe_notifier.py │ │ ├── poller.py │ │ ├── serializer.py │ │ ├── syncobj.py │ │ ├── syncobj_admin.py │ │ ├── tcp_connection.py │ │ ├── tcp_server.py │ │ ├── transport.py │ │ ├── utility.py │ │ ├── version.py │ │ └── win_inet_pton.py ├── scripts │ ├── env.sh │ ├── mc.ini │ ├── run.py │ ├── run.sh │ ├── run_one_testcase.sh │ ├── sim.ini │ ├── start_docker.sh │ ├── system_config.sh │ └── testcase_generator.py └── specs │ ├── FifoNetwork.tla │ └── PySyncObj.tla ├── RaftOS ├── Makefile ├── bugs │ ├── commitment_not_advanced │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── UdpNetwork.tla │ │ ├── raftOs.tla │ │ └── raftos │ │ │ └── raftos │ │ │ ├── __init__.py │ │ │ ├── conf.py │ │ │ ├── cryptors.py │ │ │ ├── exceptions.py │ │ │ ├── log.py │ │ │ ├── network.py │ │ │ ├── replicator.py │ │ │ ├── serializers.py │ │ │ ├── server.py │ │ │ ├── state.py │ │ │ ├── storage.py │ │ │ └── timer.py │ ├── incorrect_erasing_entries │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── UdpNetwork.tla │ │ ├── raftOs.tla │ │ └── raftos │ │ │ └── raftos │ │ │ ├── __init__.py │ │ │ ├── conf.py │ │ │ ├── cryptors.py │ │ │ ├── exceptions.py │ │ │ ├── log.py │ │ │ ├── network.py │ │ │ ├── replicator.py │ │ │ ├── serializers.py │ │ │ ├── server.py │ │ │ ├── state.py │ │ │ ├── storage.py │ │ │ └── timer.py │ └── non_monotonic_match_idx │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── UdpNetwork.tla │ │ ├── raftOs.tla │ │ └── raftos │ │ └── raftos │ │ ├── __init__.py │ │ ├── conf.py │ │ ├── cryptors.py │ │ ├── exceptions.py │ │ ├── log.py │ │ ├── network.py │ │ ├── replicator.py │ │ ├── serializers.py │ │ ├── server.py │ │ ├── state.py │ │ ├── storage.py │ │ └── timer.py ├── raftos │ ├── raftos │ │ ├── __init__.py │ │ ├── conf.py │ │ ├── cryptors.py │ │ ├── exceptions.py │ │ ├── log.py │ │ ├── network.py │ │ ├── replicator.py │ │ ├── serializers.py │ │ ├── server.py │ │ ├── state.py │ │ ├── storage.py │ │ └── timer.py │ └── venv.tar.gz ├── scripts │ ├── env.sh │ ├── run_one_testcase.sh │ ├── start_docker.sh │ ├── system_config.sh │ └── testcase_generator.py └── specs │ ├── UdpNetwork.tla │ └── raftOs.tla ├── WRaft-series ├── DaosRaft │ ├── bugs │ │ └── leader_votes_for_others │ │ │ ├── DaosRaft.tla │ │ │ ├── FifoNetwork.tla │ │ │ ├── MC.ini │ │ │ └── MC.out │ ├── scripts │ │ ├── env.sh │ │ ├── run_one_testcase.sh │ │ ├── start_docker.sh │ │ ├── system_config.sh │ │ └── testcase_generator.py │ └── specs │ │ ├── DaosRaft.tla │ │ └── FifoNetwork.tla ├── Makefile ├── RedisRaft │ └── specs │ │ ├── FifoNetwork.tla │ │ ├── RedisRaft.tla │ │ ├── RedisRaftUdp.tla │ │ └── UdpNetwork.tla ├── WRaft │ ├── bugs │ │ ├── inconsistent_committed_log │ │ │ ├── MC.ini │ │ │ ├── MC.out │ │ │ └── WillemtRaft.tla │ │ ├── incorrect_appending_entries │ │ │ ├── MC.ini │ │ │ ├── MC.out │ │ │ └── WillemtRaft.tla │ │ ├── next_idx_no_greater_than_match_idx │ │ │ ├── MC.ini │ │ │ ├── MC.out │ │ │ └── WillemtRaft.tla │ │ ├── non_monotonic_current_term │ │ │ ├── MC.ini │ │ │ ├── MC.out │ │ │ └── WillemtRaft.tla │ │ └── retry_empty_logs │ │ │ ├── MC.ini │ │ │ ├── MC.out │ │ │ └── WillemtRaft.tla │ ├── scripts │ │ ├── env.sh │ │ ├── run_one_testcase.sh │ │ ├── start_docker.sh │ │ ├── system_config.sh │ │ └── testcase_generator.py │ └── specs │ │ └── WillemtRaft.tla └── driver │ ├── CMakeLists.txt │ ├── Config.cpp │ ├── Config.h │ ├── Network.cpp │ ├── Network.h │ ├── Node.cpp │ ├── Node.h │ ├── Raft.h │ ├── Repl.cpp │ ├── Repl.h │ ├── TcpNetwork.cpp │ ├── TcpNetwork.h │ ├── cmake │ └── FindReadline.cmake │ ├── common.cpp │ ├── common.h │ ├── deps │ ├── DaosRaft.cpp │ ├── DaosRaft │ │ ├── .github │ │ │ └── CODEOWNERS │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── Jenkinsfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── Makefile-rpm.mk │ │ ├── README.rst │ │ ├── SConscript │ │ ├── contrib │ │ │ └── CLinkedListQueue │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── linked_list_queue.c │ │ │ │ ├── linked_list_queue.h │ │ │ │ ├── package.json │ │ │ │ └── tests │ │ │ │ ├── CuTest.c │ │ │ │ ├── CuTest.h │ │ │ │ ├── make-tests.sh │ │ │ │ └── test_linked_list_queue.c │ │ ├── debian │ │ │ ├── changelog │ │ │ ├── compat │ │ │ ├── control │ │ │ ├── copyright │ │ │ ├── libraft-dev.dirs │ │ │ ├── libraft-dev.install │ │ │ ├── libraft0.dirs │ │ │ ├── libraft0.install │ │ │ ├── raft-docs.docs │ │ │ ├── rules │ │ │ └── source │ │ │ │ └── format │ │ ├── include │ │ │ ├── raft.h │ │ │ ├── raft_log.h │ │ │ ├── raft_private.h │ │ │ └── raft_types.h │ │ ├── package.json │ │ ├── packaging │ │ │ ├── Dockerfile.centos.7 │ │ │ ├── Dockerfile.coverity │ │ │ ├── Dockerfile.ubuntu.20.04 │ │ │ ├── Dockerfile.ubuntu.rolling │ │ │ ├── Makefile_distro_vars.mk │ │ │ ├── Makefile_packaging.mk │ │ │ └── rpmlint--ignore-unused-rpmlintrc.patch │ │ ├── raft.rpmlintrc │ │ ├── raft.spec │ │ ├── scripts │ │ │ └── amalgamate.sh │ │ ├── src │ │ │ ├── SConscript │ │ │ ├── raft_log.c │ │ │ ├── raft_node.c │ │ │ ├── raft_server.c │ │ │ └── raft_server_properties.c │ │ └── tests │ │ │ ├── CuTest.c │ │ │ ├── CuTest.h │ │ │ ├── log_fuzzer.py │ │ │ ├── make-tests.sh │ │ │ ├── mock_send_functions.c │ │ │ ├── mock_send_functions.h │ │ │ ├── test_log.c │ │ │ ├── test_node.c │ │ │ ├── test_scenario.c │ │ │ ├── test_server.c │ │ │ └── test_snapshotting.c │ ├── RedisRaft.cpp │ ├── RedisRaft │ │ ├── .github │ │ │ └── workflows │ │ │ │ ├── ci.yml │ │ │ │ └── daily.yml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── bin │ │ │ └── .gitignore │ │ ├── docs │ │ │ └── Using.md │ │ ├── include │ │ │ ├── raft.h │ │ │ ├── raft_log.h │ │ │ ├── raft_private.h │ │ │ └── raft_types.h │ │ ├── package.json │ │ ├── scripts │ │ │ └── amalgamate.sh │ │ ├── src │ │ │ ├── raft_log.c │ │ │ ├── raft_node.c │ │ │ ├── raft_server.c │ │ │ └── raft_server_properties.c │ │ └── tests │ │ │ ├── CuTest.c │ │ │ ├── CuTest.h │ │ │ ├── helpers.h │ │ │ ├── linked_list_queue.c │ │ │ ├── linked_list_queue.h │ │ │ ├── log_fuzzer.py │ │ │ ├── mock_send_functions.c │ │ │ ├── mock_send_functions.h │ │ │ ├── requirements.txt │ │ │ ├── test_log.c │ │ │ ├── test_log_impl.c │ │ │ ├── test_node.c │ │ │ ├── test_scenario.c │ │ │ ├── test_server.c │ │ │ ├── test_snapshotting.c │ │ │ └── virtraft2.py │ ├── WRaft.cpp │ └── WRaft │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.rst │ │ ├── include │ │ ├── raft.h │ │ ├── raft_log.h │ │ ├── raft_private.h │ │ └── raft_types.h │ │ ├── package.json │ │ ├── scripts │ │ └── amalgamate.sh │ │ ├── src │ │ ├── raft_log.c │ │ ├── raft_node.c │ │ ├── raft_server.c │ │ └── raft_server_properties.c │ │ └── tests │ │ ├── CuTest.c │ │ ├── CuTest.h │ │ ├── log_fuzzer.py │ │ ├── make-tests.sh │ │ ├── mock_send_functions.c │ │ ├── mock_send_functions.h │ │ ├── raft_cffi.py │ │ ├── test_log.c │ │ ├── test_node.c │ │ ├── test_scenario.c │ │ ├── test_server.c │ │ ├── test_snapshotting.c │ │ └── virtraft2.py │ ├── main.cpp │ └── tlpi │ ├── CMakeLists.txt │ ├── inet_sockets.c │ ├── inet_sockets.h │ └── tlpi_hdr.h ├── Xraft-series ├── Makefile ├── bugs │ ├── election_safety │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── XRaft.tla │ │ └── kv-store │ │ │ ├── bin │ │ │ ├── xraft-kvstore │ │ │ └── xraft-kvstore-cli │ │ │ ├── cli.sh │ │ │ ├── conf │ │ │ ├── log4j2.xml │ │ │ └── xraft-kvstore.properties │ │ │ ├── data │ │ │ └── .keep │ │ │ ├── lib │ │ │ ├── commons-cli-1.4.jar │ │ │ ├── failureaccess-1.0.1.jar │ │ │ ├── guava-29.0-jre.jar │ │ │ ├── jline-3.9.0.jar │ │ │ ├── jsr305-3.0.2.jar │ │ │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ │ │ ├── log4j-api-2.11.1.jar │ │ │ ├── log4j-core-2.11.1.jar │ │ │ ├── log4j-slf4j-impl-2.11.1.jar │ │ │ ├── netty-buffer-4.1.46.Final.jar │ │ │ ├── netty-codec-4.1.46.Final.jar │ │ │ ├── netty-common-4.1.46.Final.jar │ │ │ ├── netty-handler-4.1.46.Final.jar │ │ │ ├── netty-resolver-4.1.46.Final.jar │ │ │ ├── netty-transport-4.1.46.Final.jar │ │ │ ├── protobuf-java-3.16.3.jar │ │ │ ├── slf4j-api-1.7.25.jar │ │ │ ├── xraft-core-0.1.0-SNAPSHOT.jar │ │ │ └── xraft-kvstore-0.1.0-SNAPSHOT.jar │ │ │ ├── log │ │ │ └── .keep │ │ │ └── start.sh │ └── linearizability │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ ├── XRaftKVS.tla │ │ └── kv-store │ │ ├── bin │ │ ├── xraft-kvstore │ │ └── xraft-kvstore-cli │ │ ├── cli.sh │ │ ├── conf │ │ ├── log4j2.xml │ │ └── xraft-kvstore.properties │ │ ├── data │ │ └── .keep │ │ ├── lib │ │ ├── commons-cli-1.4.jar │ │ ├── failureaccess-1.0.1.jar │ │ ├── guava-32.0.0-jre.jar │ │ ├── jline-3.9.0.jar │ │ ├── jsr305-3.0.2.jar │ │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ │ ├── log4j-api-2.11.1.jar │ │ ├── log4j-core-2.11.1.jar │ │ ├── log4j-slf4j-impl-2.11.1.jar │ │ ├── netty-buffer-4.1.94.Final.jar │ │ ├── netty-codec-4.1.94.Final.jar │ │ ├── netty-common-4.1.94.Final.jar │ │ ├── netty-handler-4.1.94.Final.jar │ │ ├── netty-resolver-4.1.94.Final.jar │ │ ├── netty-transport-4.1.94.Final.jar │ │ ├── netty-transport-native-unix-common-4.1.94.Final.jar │ │ ├── protobuf-java-3.16.3.jar │ │ ├── slf4j-api-1.7.25.jar │ │ ├── xraft-core-0.1.0-SNAPSHOT.jar │ │ └── xraft-kvstore-0.1.0-SNAPSHOT.jar │ │ ├── log │ │ └── .keep │ │ └── start.sh ├── scripts │ ├── branch_counter.py │ ├── env.sh │ ├── mc.ini │ ├── run.py │ ├── run.sh │ ├── run_one_testcase.sh │ ├── sim.ini │ ├── start_docker.sh │ ├── state_collector.py │ ├── system_config.sh │ └── testcase_generator.py └── specs │ ├── FifoNetwork.tla │ ├── XRaft.tla │ ├── XRaftKVS.tla │ └── XRaftPrevote.tla └── ZooKeeper ├── Makefile ├── v3.4.3 ├── bugs │ └── vote_circle │ │ ├── FastLeaderElection.tla │ │ ├── FifoNetwork.tla │ │ ├── MC.ini │ │ ├── MC.out │ │ └── Zab.tla ├── scripts │ ├── env.sh │ ├── run.py │ ├── run.sh │ ├── run_one_testcase.sh │ ├── start_docker.sh │ ├── state_collector.py │ ├── system_config.sh │ └── testcase_generator.py ├── specs │ ├── FastLeaderElection.tla │ ├── FifoNetwork.tla │ └── Zab.tla └── zookeeper-3.4.3 │ ├── bin │ ├── README.txt │ ├── zkCleanup.sh │ ├── zkCli.cmd │ ├── zkCli.sh │ ├── zkEnv.cmd │ ├── zkEnv.sh │ ├── zkServer.cmd │ └── zkServer.sh │ ├── conf │ ├── configuration.xsl │ ├── log4j.properties │ └── zoo_sample.cfg │ ├── contrib │ ├── ZooInspector │ │ ├── config │ │ │ ├── defaultConnectionSettings.cfg │ │ │ └── defaultNodeVeiwers.cfg │ │ ├── icons │ │ │ ├── edtsrclkup_co.gif │ │ │ ├── file_obj.gif │ │ │ ├── fldr_obj.gif │ │ │ ├── info_obj.gif │ │ │ ├── jspdecl.gif │ │ │ ├── launch_run.gif │ │ │ ├── launch_stop.gif │ │ │ ├── new_con.gif │ │ │ ├── refresh.gif │ │ │ ├── save_edit.gif │ │ │ ├── search_next.gif │ │ │ ├── search_prev.gif │ │ │ └── trash.gif │ │ ├── lib │ │ │ └── jtoaster-1.0.4.jar │ │ ├── licences │ │ │ ├── Apache Software Licence v2.0.txt │ │ │ └── epl-v10.html │ │ └── zookeeper-3.4.3-ZooInspector.jar │ ├── fatjar │ │ ├── conf │ │ │ └── mainClasses │ │ └── zookeeper-3.4.3-fatjar.jar │ ├── loggraph │ │ └── zookeeper-3.4.3-loggraph.jar │ ├── rest │ │ └── zookeeper-3.4.3-rest.jar │ ├── zkfuse │ │ ├── Makefile.am │ │ ├── README.txt │ │ ├── VERSION │ │ └── configure.ac │ ├── zkperl │ │ ├── Changes │ │ ├── LICENSE │ │ ├── MANIFEST │ │ ├── Makefile.PL │ │ ├── NOTICE │ │ ├── README │ │ ├── VERSION │ │ ├── ZooKeeper.pm │ │ ├── ZooKeeper.xs │ │ ├── t │ │ │ ├── 10_invalid.t │ │ │ ├── 15_thread.t │ │ │ ├── 20_tie.t │ │ │ ├── 22_stat_tie.t │ │ │ ├── 24_watch_tie.t │ │ │ ├── 30_connect.t │ │ │ ├── 35_log.t │ │ │ ├── 40_basic.t │ │ │ ├── 45_class.t │ │ │ ├── 50_access.t │ │ │ ├── 60_watch.t │ │ │ └── util.pl │ │ └── typemap │ ├── zkpython │ │ ├── README │ │ ├── VERSION │ │ └── ivy.xml │ └── zktreeutil │ │ ├── Makefile.am │ │ ├── README.txt │ │ ├── VERSION │ │ ├── configure.ac │ │ └── tests │ │ └── zk_sample.xml │ ├── dist-maven │ ├── zookeeper-3.4.3-javadoc.jar │ ├── zookeeper-3.4.3-sources.jar │ ├── zookeeper-3.4.3-tests.jar │ ├── zookeeper-3.4.3.jar │ └── zookeeper-3.4.3.pom │ ├── lib │ ├── cobertura │ │ └── README.txt │ ├── jdiff │ │ ├── zookeeper_3.1.1.xml │ │ └── zookeeper_3.4.3.xml │ ├── jline-0.9.94.LICENSE.txt │ ├── jline-0.9.94.jar │ ├── log4j-1.2.15.LICENSE.txt │ ├── log4j-1.2.15.jar │ ├── netty-3.2.2.Final.jar │ ├── slf4j-api-1.6.1.jar │ └── slf4j-log4j12-1.6.1.jar │ ├── start.sh │ └── zookeeper-3.4.3.jar └── v3.9.0 ├── apache-zookeeper-3.9.0-bin ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── README_packaging.md ├── bin │ ├── README.txt │ ├── zkCleanup.sh │ ├── zkCli.cmd │ ├── zkCli.sh │ ├── zkEnv.cmd │ ├── zkEnv.sh │ ├── zkServer-initialize.sh │ ├── zkServer.cmd │ ├── zkServer.sh │ ├── zkSnapShotToolkit.cmd │ ├── zkSnapShotToolkit.sh │ ├── zkSnapshotComparer.cmd │ ├── zkSnapshotComparer.sh │ ├── zkSnapshotRecursiveSummaryToolkit.cmd │ ├── zkSnapshotRecursiveSummaryToolkit.sh │ ├── zkTxnLogToolkit.cmd │ └── zkTxnLogToolkit.sh ├── conf │ ├── configuration.xsl │ ├── logback.xml │ └── zoo_sample.cfg ├── lib │ ├── audience-annotations-0.12.0.jar │ ├── commons-cli-1.5.0.LICENSE.txt │ ├── commons-cli-1.5.0.jar │ ├── commons-io-2.11.0.LICENSE.txt │ ├── commons-io-2.11.0.jar │ ├── jackson-annotations-2.15.2.jar │ ├── jackson-core-2.15.2.jar │ ├── jackson-databind-2.15.2.jar │ ├── javax.servlet-api-3.1.0.jar │ ├── jetty-http-9.4.51.v20230217.LICENSE.txt │ ├── jetty-http-9.4.51.v20230217.jar │ ├── jetty-io-9.4.51.v20230217.LICENSE.txt │ ├── jetty-io-9.4.51.v20230217.jar │ ├── jetty-security-9.4.51.v20230217.LICENSE.txt │ ├── jetty-security-9.4.51.v20230217.jar │ ├── jetty-server-9.4.51.v20230217.LICENSE.txt │ ├── jetty-server-9.4.51.v20230217.jar │ ├── jetty-servlet-9.4.51.v20230217.LICENSE.txt │ ├── jetty-servlet-9.4.51.v20230217.jar │ ├── jetty-util-9.4.51.v20230217.LICENSE.txt │ ├── jetty-util-9.4.51.v20230217.jar │ ├── jetty-util-ajax-9.4.51.v20230217.LICENSE.txt │ ├── jetty-util-ajax-9.4.51.v20230217.jar │ ├── jline-2.14.6.LICENSE.txt │ ├── jline-2.14.6.jar │ ├── logback-classic-1.2.10.LICENSE.txt │ ├── logback-classic-1.2.10.jar │ ├── logback-core-1.2.10.LICENSE.txt │ ├── logback-core-1.2.10.jar │ ├── metrics-core-4.1.12.1.jar │ ├── metrics-core-4.1.12.1.jar_LICENSE.txt │ ├── netty-bom-4.1.94.Final.LICENSE.txt │ ├── netty-buffer-4.1.94.Final.LICENSE.txt │ ├── netty-buffer-4.1.94.Final.jar │ ├── netty-codec-4.1.94.Final.LICENSE.txt │ ├── netty-codec-4.1.94.Final.jar │ ├── netty-common-4.1.94.Final.LICENSE.txt │ ├── netty-common-4.1.94.Final.jar │ ├── netty-handler-4.1.94.Final.LICENSE.txt │ ├── netty-handler-4.1.94.Final.jar │ ├── netty-resolver-4.1.94.Final.LICENSE.txt │ ├── netty-resolver-4.1.94.Final.jar │ ├── netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar │ ├── netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar │ ├── netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar │ ├── netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar │ ├── netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar │ ├── netty-tcnative-boringssl-static-2.0.61.Final.jar │ ├── netty-tcnative-classes-2.0.61.Final.jar │ ├── netty-transport-4.1.94.Final.LICENSE.txt │ ├── netty-transport-4.1.94.Final.jar │ ├── netty-transport-classes-epoll-4.1.94.Final.jar │ ├── netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar │ ├── netty-transport-native-epoll-4.1.94.Final.LICENSE.txt │ ├── netty-transport-native-unix-common-4.1.94.Final.LICENSE.txt │ ├── netty-transport-native-unix-common-4.1.94.Final.jar │ ├── simpleclient-0.9.0.LICENSE.txt │ ├── simpleclient-0.9.0.jar │ ├── simpleclient_common-0.9.0.jar │ ├── simpleclient_common-0.9.0_LICENSE.txt │ ├── simpleclient_hotspot-0.9.0.jar │ ├── simpleclient_hotspot-0.9.0_LICENSE.txt │ ├── simpleclient_servlet-0.9.0.jar │ ├── simpleclient_servlet-0.9.0_LICENSE.txt │ ├── slf4j-1.7.30.LICENSE.txt │ ├── slf4j-api-1.7.30.jar │ ├── snappy-java-1.1.10.1.jar │ ├── snappy-java-1.1.10.1.jar_LICENSE.txt │ ├── zookeeper-3.9.0.jar │ ├── zookeeper-jute-3.9.0.jar │ └── zookeeper-prometheus-metrics-3.9.0.jar └── start.sh ├── scripts ├── env.sh ├── run.py ├── run.sh ├── run_one_testcase.sh ├── start_docker.sh ├── state_collector.py ├── system_config.sh └── testcase_generator.py └── specs ├── FastLeaderElection.tla ├── FifoNetwork.tla └── Zab.tla /.gitignore: -------------------------------------------------------------------------------- 1 | # Global 2 | .idea 3 | .vscode 4 | *build* 5 | *cache* 6 | .*.swp 7 | venv 8 | 9 | # Generated 10 | config.txt 11 | traces.txt 12 | tlc_trace.txt 13 | *.csv 14 | 15 | # specs 16 | *.toolbox 17 | model 18 | *.dvi 19 | *.pdf 20 | **/specs/*.tex 21 | 22 | # docker 23 | *mount* 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Ruize Tang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile.inc: -------------------------------------------------------------------------------- 1 | BACKEND ?= docker 2 | 3 | ifeq ($(BACKEND),docker) 4 | INTERACTIVE_OR_SEP := "-it" 5 | CONTROLLER_NODE := "controller" 6 | else 7 | BACKEND := lxc 8 | INTERACTIVE_OR_SEP := "--" 9 | CONTROLLER_NODE := "sandtable-lxc" 10 | endif 11 | -------------------------------------------------------------------------------- /doc/Bugs-Descriptions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/doc/Bugs-Descriptions.pdf -------------------------------------------------------------------------------- /doc/Bugs-Descriptions_EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/doc/Bugs-Descriptions_EN.pdf -------------------------------------------------------------------------------- /doc/SandTable-Design.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/doc/SandTable-Design.pdf -------------------------------------------------------------------------------- /doc/SandTable-Paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/doc/SandTable-Paper.pdf -------------------------------------------------------------------------------- /docker/requirements.txt: -------------------------------------------------------------------------------- 1 | jq>=1.3.0 2 | requests>=2.28.1 3 | inotify>=0.2.10 4 | psutil>=5.9.3 -------------------------------------------------------------------------------- /scripts/CommunityModules-deps.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/scripts/CommunityModules-deps.jar -------------------------------------------------------------------------------- /scripts/common/run_one_testcase_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TRACE=$1 4 | SERVERS=${2:-3} 5 | if [ -n "$2" ]; then 6 | shift 2 7 | else 8 | shift 1 9 | fi 10 | 11 | check_vars "TRACE" "SERVERS" 12 | 13 | TRACE_DIR=$(realpath $(dirname $TRACE)) 14 | TEST_DIR=$TRACE_DIR/test 15 | TEST_TRACE=$TEST_DIR/trace 16 | CONFIG_FILE=$TEST_DIR/config/config.txt 17 | BACKEND=${BACKEND:-docker} 18 | if [ "$BACKEND" = "lxc" ]; then 19 | SUBNET=10.2.0.0/24 20 | export CONTROLLER_NODE=${CONTROLLER_NODE:-sandtable-lxc} 21 | export NAMESERVER=${NAMESERVER:-@$(ip route show 0.0.0.0/0 dev eth0 | cut -d' ' -f3)} 22 | export MASQUERADE=${MASQUERADE:-$(ip route show 0.0.0.0/0 dev eth0 | sed -En -e 's/.*via ([0-9.]+) .*/\1/' -e 's,\.1$,.0/24,p')} 23 | else 24 | SUBNET=10.1.0.0/24 25 | export CONTROLLER_NODE=${CONTROLLER_NODE:-controller} 26 | fi 27 | 28 | set -e 29 | mkdir -p $TEST_DIR/config 30 | cp $TRACE $TEST_TRACE 31 | bash $system_config_sh ${SERVERS} ${SUBNET} $CONFIG_FILE 32 | cd $TEST_DIR 33 | python3 $testcase_generator_py -i -c $CONFIG_FILE $TEST_TRACE "$@" 34 | 35 | env -u TMUX bash $start_docker_sh $TEST_DIR 36 | -------------------------------------------------------------------------------- /scripts/common/start_docker_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TIMEOUT=60 4 | 5 | function usage() { 6 | echo "Usage: start.sh trace_xxx.dir" 7 | exit 1 8 | } 9 | 10 | TESTCASE_DIR=$1 11 | if ! test -d "$TESTCASE_DIR"; then 12 | usage 13 | fi 14 | TESTCASE_DIR=$(realpath $TESTCASE_DIR) 15 | 16 | export TMPDIR=$(mktemp -u -d -p $TESTCASE_DIR) 17 | mkdir -p $TMPDIR 18 | TIMEOUT_ARG="-T $TIMEOUT" 19 | 20 | cd $TESTCASE_DIR 21 | CONFIG_FILE=$(realpath config/config.txt) 22 | -------------------------------------------------------------------------------- /scripts/common/system_config_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | COUNT=${1:-3} 4 | SUBNET=${2} 5 | GEN_FILE=${3} 6 | CONTROLLER_NODE=${CONTROLLER_NODE:-controller} 7 | 8 | check_vars COUNT SUBNET GEN_FILE 9 | 10 | eval $GENERATE_CONFIG_SH -P -b dig -s $SUBNET -t traces.txt ${CONTROLLER_NODE} n{$(seq -s, 1 $COUNT)} > "$GEN_FILE" 11 | -------------------------------------------------------------------------------- /scripts/common/wait_tmux_common.sh: -------------------------------------------------------------------------------- 1 | if test -t 0; then 2 | tmux attach -t SSH$(echo -n $TMPDIR | tail -c 4)>/dev/null 3 | else 4 | tmux wait-for "$TMPDIR" 5 | fi -------------------------------------------------------------------------------- /scripts/docker_rsync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if test -f /.dockerenv; then 6 | echo Should not run inside docker 7 | exit 8 | fi 9 | 10 | PROJECT_DIR=$(realpath "$(dirname "$(realpath "$0")")"/..) 11 | 12 | cd "$PROJECT_DIR" 13 | mkdir -p build/mount 14 | rsync -av --exclude='*.toolbox' --exclude='__pycache__' --exclude='model' --exclude='build' --exclude='config.txt' \ 15 | ./src ./scripts ./systems Makefile Makefile.inc build/mount 16 | -------------------------------------------------------------------------------- /scripts/tla2tools.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/scripts/tla2tools.jar -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | project(SandTable) 4 | 5 | # for debug 6 | include(CMakePrintHelpers) 7 | 8 | add_subdirectory(controller) 9 | add_subdirectory(interceptor) 10 | -------------------------------------------------------------------------------- /src/controller/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(controller CXX) 3 | 4 | set(CMAKE_CXX_STANDARD 20) 5 | 6 | add_compile_options(-Wall -Wextra -Werror -Wno-cast-function-type) 7 | 8 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") 9 | 10 | find_package(gflags REQUIRED) 11 | find_package(Readline REQUIRED) 12 | find_package(ConcurrentQueue REQUIRED) 13 | 14 | add_executable(controller main.cpp TcpSocket.cpp TcpSocket.h common.h ConfigFile.cpp ConfigFile.h 15 | TcpNetwork.cpp TcpNetwork.h Command.cpp Command.h Repl.cpp Repl.h 16 | Socket.cpp Socket.h RemoteControl.cpp RemoteControl.h Msg.cpp Msg.h 17 | UdpNetwork.h UdpNetwork.cpp UdpSocket.cpp UdpSocket.h) 18 | target_link_libraries(controller PUBLIC 19 | gflags 20 | readline 21 | pthread 22 | ) 23 | -------------------------------------------------------------------------------- /src/controller/Msg.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 10/12/22. 3 | // 4 | 5 | #include "Msg.h" 6 | 7 | Msg &Msg::operator=(Msg &&m) noexcept { // move assign 8 | fd = std::move(m.fd); 9 | content = std::move(m.content); 10 | size = m.size; 11 | header = (struct MsgHeader *)buffer(); 12 | m.size = 0; 13 | m.header = nullptr; 14 | return *this; 15 | } 16 | 17 | Msg::Msg(const shared_ptr &sockfd, const MsgHeader &h) { 18 | fd = sockfd; 19 | size = ntohl(h.size); 20 | content.resize(size + sizeof(struct MsgHeader)); 21 | header = (struct MsgHeader *)buffer(); 22 | *header = h; 23 | } 24 | 25 | UdpMsg::UdpMsg(uint32_t seq, char* content, struct sockaddr_in* src, struct sockaddr_in* dst){ 26 | this -> sequential = seq; 27 | this -> content = content; 28 | this -> src = src; 29 | this -> dst = dst; 30 | } 31 | 32 | UdpMsg::UdpMsg(const UdpMsg& udpmsg) { 33 | this -> sequential = udpmsg.sequential; 34 | this -> content = udpmsg.content; 35 | this -> src = udpmsg.src; 36 | this -> dst = udpmsg.dst; 37 | } 38 | 39 | void UdpMsg::set_seq(int seq) { 40 | this -> sequential = seq; 41 | } 42 | 43 | void UdpMsg::show() const { 44 | cerr << sequential << " : " << content << " " 45 | << configFile.get_node_name_with_addr(*src) << " -> "<< configFile.get_node_name_with_addr(*dst)< 10 | 11 | class RemoteControl { 12 | private: 13 | map router_to_interceptor; 14 | map router_to_ssh; // append only 15 | string tmpdir; 16 | int do_send(int fd, const string &cmd); 17 | bool recv_ack(const string &node); 18 | int get_node_idx(const string &node) const; 19 | string cache_cmp_data; 20 | string convert_special_char(const string &cmd); 21 | public: 22 | RemoteControl(); 23 | ~RemoteControl(); 24 | int add_node(const string &node); 25 | int add_node(const string &node, int interceptor_fd); 26 | int try_add_node(double timeout); 27 | int send_cmd_interceptor(const string &node, const string &cmd, int lineno); 28 | bool send_cmd_ssh(const string &node, const string &cmd); 29 | bool send_cmd_ssh_asy(const string &node, const string &cmd); 30 | string get_cache_cmp_data() const { 31 | return cache_cmp_data; 32 | } 33 | void clear_cache_cmp_data() { 34 | cache_cmp_data.clear(); 35 | } 36 | }; 37 | 38 | extern RemoteControl *remote_control; 39 | 40 | 41 | #endif //TPROXY_REMOTECONTROL_H 42 | -------------------------------------------------------------------------------- /src/controller/Repl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/25/22. 3 | // 4 | 5 | #include "Repl.h" 6 | #include "common.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | void Repl::readline() { 13 | char *line; 14 | #define CHECK_ARGS(argc) if (!c.check_prompt_invalid(argc)) continue; else cerr_verbose << "Read cmd: " << c << endl 15 | while ((line = ::readline(prompt)) != NULL) { 16 | cmd_t c(line); 17 | if (c.empty()) 18 | continue; 19 | add_history(line); 20 | if (c.get_cmd() == "file") { 21 | CHECK_ARGS(2); 22 | command.read_file(c.get_arg(1)); 23 | continue; 24 | } else if (c.get_cmd() == "exit") { 25 | break; 26 | } 27 | command.enqueue(std::move(c)); 28 | free(line); 29 | if (prompt) 30 | usleep(100000); 31 | } 32 | command.enqueue("exit"); 33 | } 34 | 35 | Repl::Repl() { 36 | if (!isatty(STDIN_FILENO)) 37 | prompt = NULL; 38 | } 39 | -------------------------------------------------------------------------------- /src/controller/Repl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/25/22. 3 | // 4 | 5 | #ifndef TPROXY_REPL_H 6 | #define TPROXY_REPL_H 7 | 8 | class Repl { 9 | private: 10 | const char *prompt = "\033[1;36m" "(REPL) " "\033[0m"; 11 | public: 12 | Repl(); 13 | void readline(); 14 | }; 15 | 16 | 17 | #endif //TPROXY_REPL_H 18 | -------------------------------------------------------------------------------- /src/controller/Socket.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 10/8/22. 3 | // 4 | 5 | #include "Socket.h" 6 | #include 7 | 8 | int Socket::set_nonblocking(int fd) { 9 | int flags = fcntl(fd, F_GETFL, 0); 10 | if (flags == -1) { 11 | // warn_syserror("set_nonblocking fcntl F_GETFL"); 12 | return -1; 13 | } 14 | flags |= O_NONBLOCK; 15 | if (fcntl(fd, F_SETFL, flags) == -1) { 16 | // warn_syserror("set_nonblocking fcntl F_SETFL"); 17 | return -1; 18 | } 19 | return 0; 20 | } -------------------------------------------------------------------------------- /src/controller/Socket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 10/8/22. 3 | // 4 | 5 | #ifndef TPROXY_SOCKET_H 6 | #define TPROXY_SOCKET_H 7 | 8 | #include "common.h" 9 | 10 | struct AcceptData { 11 | int socket_fd; 12 | struct sockaddr_in client_addr; 13 | struct sockaddr_in origin_client_addr; 14 | struct sockaddr_in origin_addr; 15 | struct sockaddr_in masque_addr; 16 | }; 17 | 18 | class Socket { 19 | public: 20 | static int set_nonblocking(int fd); 21 | virtual int socket() const = 0; 22 | // virtual AcceptData accept(int client_fd) const = 0; 23 | }; 24 | 25 | 26 | #endif //TPROXY_SOCKET_H 27 | -------------------------------------------------------------------------------- /src/controller/TcpSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-10. 3 | // 4 | 5 | #ifndef TPROXY_TCPSOCKET_H 6 | #define TPROXY_TCPSOCKET_H 7 | 8 | #include "common.h" 9 | #include "Socket.h" 10 | 11 | class TcpSocket: Socket { 12 | private: 13 | int socket_fd = -1; 14 | int bind_port = 10100; 15 | public: 16 | TcpSocket(int port=-1); 17 | int socket() const override { 18 | return socket_fd; 19 | } 20 | AcceptData accept(int client_fd = -1) const; 21 | }; 22 | 23 | #endif //TPROXY_TCPSOCKET_H 24 | -------------------------------------------------------------------------------- /src/controller/UdpSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by weiyuyang on 22-11-1. 3 | // 4 | 5 | #ifndef TPROXY_UDPSOCKET_H 6 | #define TPROXY_UDPSOCKET_H 7 | 8 | 9 | #define LOCAL_PROXY_PORT 3127 10 | #define MAX_MSG 1500 11 | #ifndef IP_TRANSPARENT 12 | #define IP_TRANSPARENT 19 13 | #endif 14 | #ifndef IP_ORIGADDRS 15 | #define IP_ORIGADDRS 20 16 | #endif 17 | #ifndef IP_RECVORIGADDRS 18 | #define IP_RECVORIGADDRS IP_ORIGADDRS 19 | #endif 20 | #define CTL_BUF_SIZE 64 21 | 22 | #include "common.h" 23 | #include "Socket.h" 24 | #include "Msg.h" 25 | 26 | 27 | 28 | class UdpSokcet: Socket { 29 | private: 30 | int socket_fd = -1; 31 | int bind_port = 10100; 32 | struct sockaddr_in proxy_addr; 33 | public: 34 | UdpSokcet(int port=-1); 35 | int socket() const override { 36 | return socket_fd; 37 | } 38 | int bindport() const { 39 | return bind_port; 40 | } 41 | }; 42 | 43 | #endif //TPROXY_UDPSOCKET_H 44 | -------------------------------------------------------------------------------- /src/controller/cmake/FindConcurrentQueue.cmake: -------------------------------------------------------------------------------- 1 | find_path(ConcurrentQueue_INCLUDE_DIR 2 | NAMES concurrentqueue/concurrentqueue.h) 3 | 4 | mark_as_advanced( 5 | ConcurrentQueue_INCLUDE_DIR) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args(ConcurrentQueue 9 | DEFAULT_MSG ConcurrentQueue_INCLUDE_DIR) 10 | -------------------------------------------------------------------------------- /src/controller/cmake/FindReadline.cmake: -------------------------------------------------------------------------------- 1 | find_path(Readline_INCLUDE_DIR 2 | NAMES readline/readline.h) 3 | 4 | find_library(Readline_LIBRARY 5 | NAMES readline) 6 | 7 | mark_as_advanced( 8 | Readline_INCLUDE_DIR 9 | Readline_LIBRARY 10 | ) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(Readline 14 | DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY) 15 | -------------------------------------------------------------------------------- /src/interceptor/myaccept.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #include "common.h" 6 | #include "myaccept.h" 7 | #include "config.h" 8 | 9 | MAKE_SYS_TEMPLATE(int, accept, int sockfd, struct sockaddr *addr, socklen_t *addrlen) { 10 | int ret = real_accept(sockfd, addr, addrlen); 11 | BEGIN_INTERCEPT; 12 | if (ret != -1 && check_addr_is_concerned_with_len((const struct sockaddr_in*)addr, *addrlen)) { 13 | // the client addr is concerned, add client fd (return value) 14 | add_concerned_fd(ret, (const struct sockaddr_in*)addr, 1); 15 | LOG_INTERCEPTED(CUR_SYSCALL, "concern, return %d, accept(sockfd: %d, addr: " ADDR_FMT ", addrlen: %d)", 16 | ret, sockfd, ADDR_TO_STR(addr), *addrlen); 17 | } 18 | END_INTERCEPT; 19 | } 20 | -------------------------------------------------------------------------------- /src/interceptor/myaccept.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYACCEPT_H 6 | #define MYSYSCALL_MYACCEPT_H 7 | 8 | //#ifndef _SYS_SOCKET_H 9 | //#define _SYS_SOCKET_H 10 | //#endif 11 | #include 12 | 13 | int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); 14 | 15 | #endif //MYSYSCALL_MYACCEPT_H 16 | -------------------------------------------------------------------------------- /src/interceptor/myaccept4.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/26/22. 3 | // 4 | 5 | #include "common.h" 6 | #include "config.h" 7 | #include "myaccept4.h" 8 | 9 | MAKE_SYS_TEMPLATE(int, accept4, int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) { 10 | int ret = real_accept4(sockfd, addr, addrlen, flags); 11 | BEGIN_INTERCEPT; 12 | if (ret != -1 && check_addr_is_concerned_with_len((const struct sockaddr_in*)addr, *addrlen)) { 13 | // the client addr is concerned, add client fd (return value) 14 | add_concerned_fd(ret, (const struct sockaddr_in*)addr, 1); 15 | LOG_INTERCEPTED(CUR_SYSCALL, "concern, return %d, accept4(sockfd: %d, addr: " ADDR_FMT ", addrlen: %d, flags: 0x%X)", 16 | ret, sockfd, ADDR_TO_STR(addr), *addrlen, flags); 17 | } 18 | END_INTERCEPT; 19 | } 20 | -------------------------------------------------------------------------------- /src/interceptor/myaccept4.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/26/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYACCEPT4_H 6 | #define MYSYSCALL_MYACCEPT4_H 7 | 8 | //#ifndef _SYS_SOCKET_H 9 | //#define _SYS_SOCKET_H 10 | //#endif 11 | #include 12 | 13 | int accept4(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen, int flags); 14 | 15 | #endif //MYSYSCALL_MYACCEPT4_H 16 | -------------------------------------------------------------------------------- /src/interceptor/myclock_getres.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 6/6/22. 3 | // 4 | 5 | #include "common.h" 6 | #include "myclock_getres.h" 7 | #include "timing.h" 8 | 9 | MAKE_SYS_TEMPLATE(int, clock_getres, clockid_t clockid, struct timespec *res) { 10 | CLOCK_START_RECORD; 11 | if (!check_count_intercepted(CUR_SYSCALL)) 12 | return real_clock_getres(clockid, res); 13 | // count_concerned(CUR_SYSCALL); 14 | LOG_INTERCEPTED(CUR_SYSCALL, "clock_getres(clockid_t: 0x%x, timespec: %p)", clockid, res); 15 | *res = resolution; 16 | CLOCK_END_RECORD; 17 | return 0; 18 | } -------------------------------------------------------------------------------- /src/interceptor/myclock_getres.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 6/6/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYCLOCK_GETRES_H 6 | #define MYSYSCALL_MYCLOCK_GETRES_H 7 | 8 | #include 9 | 10 | int clock_getres(clockid_t clockid, struct timespec *res); 11 | 12 | #endif //MYSYSCALL_MYCLOCK_GETRES_H 13 | -------------------------------------------------------------------------------- /src/interceptor/myclock_gettime.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/27/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYCLOCK_GETTIME_H 6 | #define MYSYSCALL_MYCLOCK_GETTIME_H 7 | 8 | int clock_gettime(clockid_t clockid, struct timespec *tp); 9 | 10 | #endif //MYSYSCALL_MYCLOCK_GETTIME_H 11 | -------------------------------------------------------------------------------- /src/interceptor/myclose.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #include "common.h" 6 | #include "myclose.h" 7 | #include "config.h" 8 | 9 | MAKE_SYS_TEMPLATE(int, close, int fd) { 10 | int ret = real_close(fd); 11 | BEGIN_INTERCEPT; 12 | struct sockaddr_in check_res = check_fd_is_concerned_with_addr(fd); 13 | if (check_res.sin_port != 0) { 14 | rm_concerned_fd(fd); 15 | LOG_INTERCEPTED(CUR_SYSCALL, "noconcern " ADDR_FMT ", return %d, close(fd: %d)", ADDR_TO_STR(&check_res), ret, fd); 16 | } 17 | END_INTERCEPT; 18 | } 19 | -------------------------------------------------------------------------------- /src/interceptor/myclose.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYCLOSE_H 6 | #define MYSYSCALL_MYCLOSE_H 7 | 8 | int close(int fd); 9 | 10 | #endif //MYSYSCALL_MYCLOSE_H 11 | -------------------------------------------------------------------------------- /src/interceptor/myconnect.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #include "common.h" 6 | #include "myconnect.h" 7 | #include "config.h" 8 | 9 | #include 10 | 11 | MAKE_SYS_TEMPLATE(int, connect, int sockfd, const struct sockaddr *addr, socklen_t addrlen) { 12 | if (!begin_intercept(CUR_SYSCALL)) 13 | return real_connect(sockfd, addr, addrlen); 14 | CLOCK_START_RECORD; 15 | int concerned = 0; 16 | // add in advance because connect() can be nonblocking 17 | if (check_addr_is_concerned_with_len((const struct sockaddr_in*)addr, addrlen)) { 18 | add_concerned_fd(sockfd, (const struct sockaddr_in*)addr, 0); 19 | concerned = 1; 20 | } 21 | CLOCK_END_RECORD; 22 | int ret = real_connect(sockfd, addr, addrlen); 23 | CLOCK_START_RECORD2; 24 | if (concerned == 1) { 25 | if (ret != -1 || errno == EINPROGRESS) { 26 | LOG_INTERCEPTED(CUR_SYSCALL, "concern, return %d, connect(sockfd: %d, addr: " ADDR_FMT ", addrlen: %d)", 27 | ret, sockfd, ADDR_TO_STR(addr), addrlen); 28 | } else { 29 | rm_concerned_fd(sockfd); 30 | } 31 | } 32 | CLOCK_END_RECORD2; 33 | return ret; 34 | } 35 | -------------------------------------------------------------------------------- /src/interceptor/myconnect.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYCONNECT_H 6 | #define MYSYSCALL_MYCONNECT_H 7 | 8 | //#ifndef _SYS_SOCKET_H 9 | //#define _SYS_SOCKET_H 10 | //#endif 11 | #include 12 | 13 | int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); 14 | 15 | #endif //MYSYSCALL_MYCONNECT_H 16 | -------------------------------------------------------------------------------- /src/interceptor/mygettimeofday.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/30/22. 3 | // 4 | 5 | #include "common.h" 6 | #include "mygettimeofday.h" 7 | #include "timing.h" 8 | 9 | //MAKE_COUNTER_TEMPLATE(SYS, int, gettimeofday, struct timeval *__restrict tv, void *__restrict tz) { CALL(gettimeofday, tv, tz); } 10 | 11 | MAKE_SYS_TEMPLATE(int, gettimeofday, struct timeval *tv, GETTIMEOFDAY_TYPE tz) { 12 | CLOCK_START_RECORD; 13 | if (!check_count_intercepted(CUR_SYSCALL)) 14 | return real_gettimeofday(tv, tz); 15 | if (tz) { 16 | real_gettimeofday(tv, tz); 17 | } 18 | struct timespec mono = increase_time(NULL); 19 | struct timespec rt = get_real_time_after(&mono); 20 | tv->tv_sec = rt.tv_sec; 21 | tv->tv_usec = rt.tv_nsec / US_TO_NS; 22 | // count_concerned(CUR_SYSCALL); 23 | LOG_INTERCEPTED(CUR_SYSCALL, "gettimeofday(timeval: {tv_sec: %ld, tv_usec: %ld}, tz: %p)", tv->tv_sec, tv->tv_usec, tz); 24 | CLOCK_END_RECORD; 25 | return 0; 26 | } -------------------------------------------------------------------------------- /src/interceptor/mygettimeofday.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/30/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYGETTIMEOFDAY_H 6 | #define MYSYSCALL_MYGETTIMEOFDAY_H 7 | 8 | #include 9 | 10 | #ifdef __linux__ 11 | #define GETTIMEOFDAY_TYPE void * 12 | #elif defined(__unix__) 13 | #define GETTIMEOFDAY_TYPE struct timezone * 14 | #endif 15 | 16 | int gettimeofday(struct timeval *tv, GETTIMEOFDAY_TYPE tz); 17 | 18 | #endif //MYSYSCALL_MYGETTIMEOFDAY_H 19 | -------------------------------------------------------------------------------- /src/interceptor/myopen.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-13. 3 | // 4 | 5 | #include "common.h" 6 | #include "myopen.h" 7 | 8 | //#ifndef _FCNTL_H 9 | //#define _FCNTL_H 10 | //#endif 11 | #include // O_CREAT and O_TMPFILE 12 | #include 13 | 14 | MAKE_SYS_TEMPLATE(int, open, const char *pathname, int flags, ...) { 15 | int ret; 16 | mode_t mode = 0; 17 | if (flags & (O_CREAT 18 | #ifdef __linux__ 19 | | O_TMPFILE 20 | #endif 21 | )) { 22 | va_list ap; 23 | va_start(ap, flags); 24 | mode = va_arg(ap, mode_t); 25 | ret = real_open(pathname, flags, mode); 26 | va_end(ap); 27 | } 28 | else 29 | ret = real_open(pathname, flags); 30 | BEGIN_INTERCEPT; 31 | // LOG_INTERCEPTED(CUR_SYSCALL, "return %d, open(pathname: \"%s\", flags: 0x%X, mode: %04o)", 32 | // ret, rstr1(pathname), flags, mode); 33 | END_INTERCEPT; 34 | } 35 | -------------------------------------------------------------------------------- /src/interceptor/myopen.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-13. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYOPEN_H 6 | #define MYSYSCALL_MYOPEN_H 7 | 8 | #include 9 | 10 | int open(const char *pathname, int flags, ...); 11 | 12 | #endif //MYSYSCALL_MYOPEN_H 13 | -------------------------------------------------------------------------------- /src/interceptor/myopenat.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-17. 3 | // 4 | 5 | #include "common.h" 6 | #include "myopenat.h" 7 | 8 | MAKE_COUNTER_TEMPLATE(SYS, int, openat, int dirfd, const char *pathname, int flags, mode_t mode) 9 | { CALL(openat, dirfd, pathname, flags, mode); } -------------------------------------------------------------------------------- /src/interceptor/myopenat.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-17. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYOPENAT_H 6 | #define MYSYSCALL_MYOPENAT_H 7 | 8 | #include 9 | 10 | int openat(int dirfd, const char *pathname, int flags, mode_t mode); 11 | 12 | #endif //MYSYSCALL_MYOPENAT_H 13 | -------------------------------------------------------------------------------- /src/interceptor/myrandom.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/26/22. 3 | // 4 | 5 | #include "common.h" 6 | #include "myrandom.h" 7 | 8 | MAKE_LIB_TEMPLATE(long, random, void) { 9 | if (check_count_intercepted(LIB_random)) { 10 | LOG_INTERCEPTED(LIB_random, "hack random return 1"); 11 | return 1; 12 | } 13 | return real_random(); 14 | } 15 | -------------------------------------------------------------------------------- /src/interceptor/myrandom.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 5/26/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYRANDOM_H 6 | #define MYSYSCALL_MYRANDOM_H 7 | 8 | long random(void); 9 | 10 | #endif //MYSYSCALL_MYRANDOM_H 11 | -------------------------------------------------------------------------------- /src/interceptor/myread.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "config.h" 3 | #include "myread.h" 4 | 5 | MAKE_SYS_TEMPLATE(ssize_t, read, int fd, void *buf, size_t count) { 6 | ssize_t ret = real_read(fd, buf, count); 7 | BEGIN_INTERCEPT; 8 | struct sockaddr_in check_res = check_fd_is_concerned_with_addr(fd); 9 | if (check_res.sin_port != 0) { 10 | LOG_INTERCEPTED(CUR_SYSCALL, "read from " ADDR_FMT ", return %d, read(fd: %d, buf: %p, count: %ld)", 11 | ADDR_TO_STR(&check_res), ret, fd, buf, count); 12 | } 13 | END_INTERCEPT; 14 | } 15 | -------------------------------------------------------------------------------- /src/interceptor/myread.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSYSCALL_MYREAD_H 2 | #define MYSYSCALL_MYREAD_H 3 | 4 | ssize_t read(int fd, void *buf, size_t count); 5 | 6 | #endif //MYSYSCALL_MYREAD_H 7 | -------------------------------------------------------------------------------- /src/interceptor/myrecv.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "config.h" 3 | #include "myrecv.h" 4 | 5 | MAKE_LIB_TEMPLATE(ssize_t, recv, int sockfd, void *buf, size_t len, int flags) { 6 | ssize_t ret = real_recv(sockfd, buf, len, flags); 7 | CLOCK_START_RECORD; 8 | struct sockaddr_in check_res = check_fd_is_concerned_with_addr(sockfd); 9 | if (check_fd_is_concerned(sockfd)) { 10 | LOG_INTERCEPTED(LIB_recv, "recv from " ADDR_FMT ", return %ld, recv(sockfd: %d, buf: %p, len: %ld, flags: 0x%x", 11 | ADDR_TO_STR(&check_res), ret, sockfd, buf, len, flags); 12 | } 13 | CLOCK_END_RECORD; 14 | return ret; 15 | } 16 | -------------------------------------------------------------------------------- /src/interceptor/myrecv.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSYSCALL_MYRECV_H 2 | #define MYSYSCALL_MYRECV_H 3 | 4 | ssize_t recv(int sockfd, void *buf, size_t len, int flags); 5 | 6 | #endif //MYSYSCALL_MYRECV_H 7 | -------------------------------------------------------------------------------- /src/interceptor/myrecvfrom.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "config.h" 3 | #include "myrecvfrom.h" 4 | 5 | MAKE_SYS_TEMPLATE(ssize_t, recvfrom, int sockfd, void *buf, size_t len, int flags, 6 | struct sockaddr *src_addr, socklen_t *addrlen) 7 | { 8 | ssize_t ret = real_recvfrom(sockfd, buf, len, flags, src_addr, addrlen); 9 | BEGIN_INTERCEPT; 10 | struct sockaddr_in check_res = check_fd_is_concerned_with_addr(sockfd); 11 | if (check_fd_is_concerned(sockfd)) { 12 | LOG_INTERCEPTED(CUR_SYSCALL, "recvfrom from " ADDR_FMT ", return %ld, recvfrom(sockfd: %d, buf: %p, len: %ld, flags: 0x%x, src_addr: %p, addrlen: %p", 13 | ADDR_TO_STR(&check_res), ret, sockfd, buf, len, flags, src_addr, addrlen); 14 | } 15 | END_INTERCEPT; 16 | } 17 | -------------------------------------------------------------------------------- /src/interceptor/myrecvfrom.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSYSCALL_MYRECVFROM_H 2 | #define MYSYSCALL_MYRECVFROM_H 3 | 4 | //#ifndef _SYS_SOCKET_H 5 | //#define _SYS_SOCKET_H 6 | //#endif 7 | #include // struct sockaddr, socklen_t 8 | 9 | ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, 10 | struct sockaddr *src_addr, socklen_t *addrlen); 11 | 12 | #endif //MYSYSCALL_MYRECVFROM_H 13 | -------------------------------------------------------------------------------- /src/interceptor/myrecvmsg.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "myrecvmsg.h" 3 | 4 | MAKE_SYS_TEMPLATE(ssize_t, recvmsg, int sockfd, struct msghdr *msg, int flags) 5 | { 6 | ssize_t ret = real_recvmsg(sockfd, msg, flags); 7 | BEGIN_INTERCEPT; 8 | LOG_INTERCEPTED(CUR_SYSCALL, "RECVMSG IS CALLED, return %d, recvmsg(sockfd: %d, msg: %p, flags: 0x%x)", 9 | ret, sockfd, msg, flags); 10 | END_INTERCEPT; 11 | } 12 | -------------------------------------------------------------------------------- /src/interceptor/myrecvmsg.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSYSCALL_MYRECVMSG_H 2 | #define MYSYSCALL_MYRECVMSG_H 3 | 4 | //#ifndef _SYS_SOCKET_H 5 | //#define _SYS_SOCKET_H 6 | //#endif 7 | #include 8 | 9 | ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); 10 | 11 | #endif //MYSYSCALL_MYRECVMSG_H 12 | -------------------------------------------------------------------------------- /src/interceptor/mysend.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-15. 3 | // 4 | 5 | #include "common.h" 6 | #include "mysend.h" 7 | #include "mysendto.h" 8 | 9 | MAKE_LIB_TEMPLATE(ssize_t, send, int sockfd, const void *buf, size_t len, int flags) { 10 | nr_send_syscall = LIB_send; 11 | return sendto(sockfd, buf, len, flags, NULL, 0); // send() equals to sendto(dest_addr:NULL, addrlen:0) 12 | } 13 | -------------------------------------------------------------------------------- /src/interceptor/mysend.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-15. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSEND_H 6 | #define MYSYSCALL_MYSEND_H 7 | 8 | extern unsigned LIB_send; 9 | ssize_t send(int sockfd, const void *buf, size_t len, int flags); 10 | 11 | #endif //MYSYSCALL_MYSEND_H 12 | -------------------------------------------------------------------------------- /src/interceptor/mysendfile.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-17. 3 | // 4 | 5 | #include "common.h" 6 | #include "mysendfile.h" 7 | 8 | #ifdef __linux__ 9 | MAKE_COUNTER_TEMPLATE(SYS, ssize_t, sendfile, int out_fd, int in_fd, off_t *offset, size_t count) 10 | { CALL(sendfile, out_fd, in_fd, offset, count); } 11 | #elif defined(__unix__) 12 | ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) { 13 | UNUSED(out_fd); 14 | UNUSED(in_fd); 15 | UNUSED(offset); 16 | UNUSED(count); 17 | return -1; 18 | } 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /src/interceptor/mysendfile.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-17. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSENDFILE_H 6 | #define MYSYSCALL_MYSENDFILE_H 7 | 8 | ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); 9 | 10 | #endif //MYSYSCALL_MYSENDFILE_H 11 | -------------------------------------------------------------------------------- /src/interceptor/mysendmmsg.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-16. 3 | // 4 | 5 | #include "common.h" 6 | #include "mysendmmsg.h" 7 | 8 | MAKE_SYS_TEMPLATE(int, sendmmsg, int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags) 9 | { 10 | int ret = real_sendmmsg(sockfd, msgvec, vlen, flags); 11 | BEGIN_INTERCEPT; 12 | LOG_INTERCEPTED(CUR_SYSCALL, "SENDMMSG IS CALLED, return %d, sendmmsg(sockfd: %d, mmsghdr: %p, vlen: %d, flags: 0x%x)", 13 | ret, sockfd, msgvec, vlen, flags); 14 | END_INTERCEPT; 15 | } 16 | -------------------------------------------------------------------------------- /src/interceptor/mysendmmsg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-16. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSENDMSG_H 6 | #define MYSYSCALL_MYSENDMSG_H 7 | 8 | //#ifndef _SYS_SOCKET_H 9 | //#define _SYS_SOCKET_H 10 | //#endif 11 | //#include 12 | #include 13 | 14 | int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags); 15 | 16 | #endif //MYSYSCALL_MYSENDMSG_H 17 | -------------------------------------------------------------------------------- /src/interceptor/mysendmsg.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-16. 3 | // 4 | 5 | #include "common.h" 6 | #include "mysendmsg.h" 7 | 8 | MAKE_SYS_TEMPLATE(ssize_t, sendmsg, int sockfd, const struct msghdr *msg, int flags) 9 | { 10 | ssize_t ret = real_sendmsg(sockfd, msg, flags); 11 | BEGIN_INTERCEPT; 12 | LOG_INTERCEPTED(CUR_SYSCALL, "SENDMSG IS CALLED, return %d, sendmsg(sockfd: %d, msg: %p, flags: 0x%x)", 13 | ret, sockfd, msg, flags); 14 | END_INTERCEPT; 15 | } 16 | -------------------------------------------------------------------------------- /src/interceptor/mysendmsg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-16. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSENDMSG_H 6 | #define MYSYSCALL_MYSENDMSG_H 7 | 8 | //#ifndef _SYS_SOCKET_H 9 | //#define _SYS_SOCKET_H 10 | //#endif 11 | #include 12 | 13 | ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); 14 | 15 | #endif //MYSYSCALL_MYSENDMSG_H 16 | -------------------------------------------------------------------------------- /src/interceptor/mysendto.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-13. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSENDTO_H 6 | #define MYSYSCALL_MYSENDTO_H 7 | 8 | //#ifndef _SYS_SOCKET_H 9 | //#define _SYS_SOCKET_H 10 | //#endif 11 | #include // struct sockaddr, socklen_t 12 | #include 13 | 14 | // if the sendto msg is concerned, send the hacked_sendto_header first before send real contents 15 | struct __attribute__((__packed__)) hacked_sendto_header { 16 | uint32_t validation; 17 | uint32_t size; // msg length 18 | }; 19 | 20 | #define VALIDATE_STR 0xdeadbeef 21 | 22 | // current call send function: write/send/sento 23 | extern __thread unsigned nr_send_syscall; 24 | 25 | ssize_t send(int sockfd, const void *buf, size_t len, int flags); 26 | ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); 27 | 28 | #endif //MYSYSCALL_MYSENDTO_H 29 | -------------------------------------------------------------------------------- /src/interceptor/mysocket.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-13. 3 | // 4 | 5 | #include "common.h" 6 | #include "mysocket.h" 7 | 8 | MAKE_SYS_TEMPLATE(int, socket, int domain, int type, int protocol) { 9 | int ret = real_socket(domain, type, protocol); 10 | BEGIN_INTERCEPT; 11 | LOG_INTERCEPTED(CUR_SYSCALL, "return %d, socket(domain: 0x%X, type: 0x%X, protocol: 0x%X)", 12 | ret, domain, type, protocol); 13 | END_INTERCEPT; 14 | } 15 | -------------------------------------------------------------------------------- /src/interceptor/mysocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-13. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSOCKET_H 6 | #define MYSYSCALL_MYSOCKET_H 7 | 8 | int socket(int domain, int type, int protocol); 9 | 10 | #endif //MYSYSCALL_MYSOCKET_H 11 | -------------------------------------------------------------------------------- /src/interceptor/mysyscall.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #include "common.h" 6 | #include "mysyscall.h" 7 | #include "config.h" 8 | #include 9 | #include 10 | 11 | typedef long long syscall_arg_t; 12 | 13 | syscall_func_t _syscall_; 14 | 15 | MAKE_LIB_TEMPLATE(SYSCALL_FUNC_TYPE, syscall, SYSCALL_FUNC_TYPE number, ...) { 16 | va_list ap; 17 | syscall_arg_t a, b, c, d, e, f; 18 | va_start(ap, number); 19 | a = va_arg(ap, syscall_arg_t); 20 | b = va_arg(ap, syscall_arg_t); 21 | c = va_arg(ap, syscall_arg_t); 22 | d = va_arg(ap, syscall_arg_t); 23 | e = va_arg(ap, syscall_arg_t); 24 | f = va_arg(ap, syscall_arg_t); 25 | va_end(ap); 26 | 27 | if (check_count_intercepted(LIB_syscall)) { 28 | count_intercepted(number); 29 | // LOG_INTERCEPTED(LIB_syscall, "concerned counter: syscall(number: %d)", number); 30 | } 31 | return real_syscall(number, a, b, c, d, e, f); 32 | } 33 | 34 | __attribute__((constructor, unused))static void set_real_syscall() { 35 | #ifdef __unix__ 36 | getpid(); // it cannot be removed 37 | #endif 38 | _syscall_ = (syscall_func_t) real_syscall; 39 | } 40 | -------------------------------------------------------------------------------- /src/interceptor/mysyscall.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-14. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYSYSCALL_H 6 | #define MYSYSCALL_MYSYSCALL_H 7 | 8 | #ifdef __linux__ 9 | #define SYSCALL_FUNC_TYPE long 10 | #define SYSCALL_FUNC_THROW __THROW 11 | #elif defined(__unix__) 12 | #define SYSCALL_FUNC_TYPE int 13 | #define SYSCALL_FUNC_THROW 14 | #endif 15 | 16 | typedef SYSCALL_FUNC_TYPE (*syscall_func_t)(SYSCALL_FUNC_TYPE number, ...); 17 | //int _my_syscall6(int n, long a1, long a2, long a3, long a4, long a5, long a6); 18 | SYSCALL_FUNC_TYPE syscall(SYSCALL_FUNC_TYPE number, ...) SYSCALL_FUNC_THROW; 19 | 20 | extern syscall_func_t _syscall_; 21 | 22 | #endif //MYSYSCALL_MYSYSCALL_H 23 | -------------------------------------------------------------------------------- /src/interceptor/mytime.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 6/6/22. 3 | // 4 | 5 | #include "common.h" 6 | #include "mytime.h" 7 | #include "timing.h" 8 | 9 | #ifdef __linux__ 10 | #define TIME_NR_NAME CUR_SYSCALL 11 | #define TEMPLATE MAKE_SYS_TEMPLATE 12 | #elif defined(__unix__) 13 | #define TIME_NR_NAME LIB_time 14 | #define TEMPLATE MAKE_LIB_TEMPLATE 15 | #endif 16 | 17 | TEMPLATE(time_t, time, time_t *tloc) { 18 | CLOCK_START_RECORD; 19 | if (!check_count_intercepted(TIME_NR_NAME)) 20 | return real_time(tloc); 21 | struct timespec mono = increase_time(NULL); 22 | struct timespec real_current_time = get_real_time_after(&mono); 23 | time_t ret = real_current_time.tv_sec; 24 | if (tloc) { 25 | if (real_time(tloc) == -1) 26 | return -1; 27 | *tloc = ret; 28 | } 29 | // count_concerned(TIME_NR_NAME); 30 | LOG_INTERCEPTED(TIME_NR_NAME, "ret %ld, time(tloc: %p)", ret, tloc); 31 | CLOCK_END_RECORD; 32 | return ret; 33 | } 34 | -------------------------------------------------------------------------------- /src/interceptor/mytime.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 6/6/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYTIME_H 6 | #define MYSYSCALL_MYTIME_H 7 | 8 | #include 9 | 10 | time_t time(time_t *tloc); 11 | 12 | #ifdef __linux__ 13 | #elif defined(__unix__) 14 | extern unsigned LIB_time; 15 | #endif 16 | 17 | #endif //MYSYSCALL_MYTIME_H 18 | -------------------------------------------------------------------------------- /src/interceptor/mywrite.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-15. 3 | // 4 | 5 | #include "common.h" 6 | #include "config.h" 7 | #include "mywrite.h" 8 | #include "mysendto.h" 9 | #include "state_collector.h" 10 | 11 | MAKE_SYS_TEMPLATE(ssize_t, write, int fd, const void *buf, size_t count) { 12 | CLOCK_START_RECORD; 13 | if (!check_intercept(CUR_SYSCALL)) 14 | return real_write(fd, buf, count); 15 | 16 | int log_fd = get_log_fd(fd); 17 | if (log_fd != -1) { 18 | write_log(log_fd, buf, count); 19 | return real_write(fd, buf, count); 20 | } 21 | else if (check_fd_is_concerned(fd)) { // write() equals send(flags:0, dest_addr:NULL, addrlen:0) 22 | if (!nr_send_syscall) 23 | nr_send_syscall = CUR_SYSCALL; 24 | CLOCK_END_RECORD; 25 | return sendto(fd, buf, count, 0, NULL, 0); 26 | } 27 | else { 28 | count_intercepted(CUR_SYSCALL); 29 | CLOCK_END_RECORD; 30 | return real_write(fd, buf, count); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/interceptor/mywrite.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-15. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYWRITE_H 6 | #define MYSYSCALL_MYWRITE_H 7 | 8 | ssize_t write(int fd, const void *buf, size_t count); 9 | 10 | #endif //MYSYSCALL_MYWRITE_H 11 | -------------------------------------------------------------------------------- /src/interceptor/mywritev.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 22-5-15. 3 | // 4 | 5 | #ifndef MYSYSCALL_MYWRITEV_H 6 | #define MYSYSCALL_MYWRITEV_H 7 | 8 | #include 9 | 10 | ssize_t writev(int fd, const struct iovec *iov, int iovcnt); 11 | 12 | #endif //MYSYSCALL_MYWRITEV_H 13 | -------------------------------------------------------------------------------- /src/interceptor/router.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 6/5/22. 3 | // 4 | 5 | #ifndef MYSYSCALL_ROUTER_H 6 | #define MYSYSCALL_ROUTER_H 7 | 8 | int connect_router(const char *addr); 9 | 10 | #endif //MYSYSCALL_ROUTER_H 11 | -------------------------------------------------------------------------------- /src/interceptor/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage() { 4 | echo "$0 [-library LIBRARY_FILE] [-config CONFIG_FILE] COMMAND [ARGS]" 5 | exit 1 6 | } 7 | 8 | check() { 9 | if [ -n "$1" -a ! -r "$1" ]; then 10 | echo "Error: cannot read file \"$1\"" 11 | exit 1 12 | fi 13 | } 14 | 15 | if [ -n "${MYSYSCALL_CONFIG}" ]; then 16 | export "MYSYSCALL_CONFIG=${MYSYSCALL_CONFIG}" 17 | elif [ -n "${CONFIG}" ]; then 18 | export "MYSYSCALL_CONFIG=${CONFIG}" 19 | fi 20 | 21 | if [ -n "${LIBRARY}" ]; then 22 | LIBRARY="${LIBRARY}" 23 | fi 24 | 25 | while [ $(printf %.1s "$1") = "-" ]; do 26 | case "$1" in 27 | -c|-config|--config) 28 | export "MYSYSCALL_CONFIG=$2" 29 | shift 2 30 | ;; 31 | -l|-library|--library) 32 | LIBRARY="$2" 33 | shift 2 34 | ;; 35 | *) 36 | usage 37 | ;; 38 | esac 39 | done 40 | 41 | export PROGRAM_PATH="${PROGRAM_PATH:-1}" 42 | 43 | if [ -z "$LIBRARY" ] || [ -z "$1" ]; then 44 | usage 45 | fi 46 | 47 | check "$LIBRARY" 48 | check "$MYSYSCALL_CONFIG" 49 | 50 | env "LD_PRELOAD=$LIBRARY" "$@" 51 | -------------------------------------------------------------------------------- /src/interceptor/state_collector.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fedora on 8/26/23. 3 | // 4 | 5 | #ifndef STATE_COLLECTOR_H 6 | #define STATE_COLLECTOR_H 7 | 8 | #include 9 | 10 | void write_log(int fd, const char *buf, size_t count); 11 | int collect_states(); 12 | char* get_state(const char* var); // must be freed after use 13 | void state_collect_thread(); 14 | 15 | #endif //STATE_COLLECTOR_H 16 | -------------------------------------------------------------------------------- /src/interceptor/version.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | # expose some symbols of the library (for ptracer) 4 | reg_func_dict; 5 | print_info_internal; 6 | # below are intercepted functions 7 | #open; 8 | send; 9 | sendto; 10 | socket; 11 | accept; 12 | connect; 13 | close; 14 | write; 15 | #free; 16 | #malloc; 17 | #calloc; 18 | #realloc; 19 | sendmsg; 20 | sendmmsg; 21 | sendfile; 22 | #openat; 23 | accept4; 24 | #random; 25 | clock_gettime; 26 | gettimeofday; 27 | #time; # if intercepted, xraft won't connect! 28 | clock_getres; # if not intercepted, xraft's timing will not be controlled 29 | syscall; 30 | writev; 31 | read; 32 | recv; 33 | recvfrom; 34 | local: 35 | *; 36 | }; 37 | -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/leader_commits_older_terms/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: PySyncObj.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | INV: INV 13 | ElectionSafety: ElectionSafety 14 | LogMatching: LogMatching 15 | NextIdxGtZero: NextIdxGtZero 16 | CommitIdxLELogLen: CommitIdxLELogLen 17 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 18 | 19 | [state constraint] 20 | SC: SC 21 | 22 | [constants] 23 | M_NNI: [model value] 24 | M_AE: [model value] 25 | M_RVR: [model value] 26 | M_RV: [model value] 27 | Leader: [model value] 28 | Follower: [model value] 29 | Candidate: [model value] 30 | NoOp: [model value] 31 | Nil: [model value] 32 | Commands: [model value]{v1, v2} 33 | Servers: [model value]{n1, n2, n3} 34 | Parameters: [MaxElectionTimes |-> 3, 35 | MaxAppenEntriesTimes |-> 3, 36 | MaxPartitionTimes |-> 1, 37 | MaxClientOperationsTimes |-> 3, 38 | MaxWireMsgs |-> 6] 39 | 40 | -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/leader_commits_older_terms/pysyncobj: -------------------------------------------------------------------------------- 1 | ../../pysyncobj-v0.3.11-with-pr171 -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/next_idx_no_greater_than_match_idx/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: PySyncObj.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | INV: INV 13 | ElectionSafety: ElectionSafety 14 | LogMatching: LogMatching 15 | 16 | [state constraint] 17 | SC: SC 18 | 19 | [constants] 20 | M_NNI: [model value] 21 | M_AE: [model value] 22 | M_RVR: [model value] 23 | M_RV: [model value] 24 | Leader: [model value] 25 | Follower: [model value] 26 | Candidate: [model value] 27 | NoOp: [model value] 28 | Nil: [model value] 29 | Commands: [model value]{v1, v2} 30 | Servers: [model value]{n1, n2} 31 | Parameters: [MaxElectionTimes |-> 2, 32 | MaxAppenEntriesTimes |-> 3, 33 | MaxPartitionTimes |-> 1, 34 | MaxClientOperationsTimes |-> 3, 35 | MaxWireMsgs |-> 6, 36 | no_inv |-> {4}] 37 | 38 | -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/next_idx_no_greater_than_match_idx/pysyncobj: -------------------------------------------------------------------------------- 1 | ../../pysyncobj-v0.3.11 -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/non_monotonic_commit_idx/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: PySyncObj.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | INV: INV 13 | ElectionSafety: ElectionSafety 14 | LogMatching: LogMatching 15 | 16 | [state constraint] 17 | SC: SC 18 | 19 | [constants] 20 | M_NNI: [model value] 21 | M_AE: [model value] 22 | M_RVR: [model value] 23 | M_RV: [model value] 24 | Leader: [model value] 25 | Follower: [model value] 26 | Candidate: [model value] 27 | NoOp: [model value] 28 | Nil: [model value] 29 | Commands: [model value]{v1, v2} 30 | Servers: [model value]{n1, n2} 31 | Parameters: [MaxElectionTimes |-> 2, 32 | MaxAppenEntriesTimes |-> 3, 33 | MaxPartitionTimes |-> 1, 34 | MaxClientOperationsTimes |-> 3, 35 | MaxWireMsgs |-> 6] 36 | -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/non_monotonic_commit_idx/pysyncobj: -------------------------------------------------------------------------------- 1 | ../../pysyncobj-v0.3.11 -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/non_monotonic_match_idx/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: PySyncObj.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | INV: INV 13 | ElectionSafety: ElectionSafety 14 | LogMatching: LogMatching 15 | 16 | [state constraint] 17 | SC: SC 18 | 19 | [constants] 20 | M_NNI: [model value] 21 | M_AE: [model value] 22 | M_RVR: [model value] 23 | M_RV: [model value] 24 | Leader: [model value] 25 | Follower: [model value] 26 | Candidate: [model value] 27 | NoOp: [model value] 28 | Nil: [model value] 29 | Commands: [model value]{v1, v2} 30 | Servers: [model value]{n1, n2} 31 | Parameters: [MaxElectionTimes |-> 2, 32 | MaxAppenEntriesTimes |-> 3, 33 | MaxPartitionTimes |-> 1, 34 | MaxClientOperationsTimes |-> 3, 35 | MaxWireMsgs |-> 6] 36 | -------------------------------------------------------------------------------- /systems/PySyncObj/bugs/non_monotonic_match_idx/pysyncobj: -------------------------------------------------------------------------------- 1 | ../../pysyncobj-v0.3.11 -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/README: -------------------------------------------------------------------------------- 1 | Version: https://github.com/bakwc/PySyncObj/releases/tag/0.3.11 2 | Applied PR: https://github.com/bakwc/PySyncObj/pull/171/files 3 | 4 | Config changes in config.py: 5 | 6 | ```diff 7 | 28c28 8 | < self.autoTick = kwargs.get('autoTick', True) 9 | --- 10 | > self.autoTick = kwargs.get('autoTick', False) 11 | 36c36 12 | < self.raftMinTimeout = kwargs.get('raftMinTimeout', 0.4) 13 | --- 14 | > self.raftMinTimeout = kwargs.get('raftMinTimeout', 0.7) 15 | 43c43 16 | < self.appendEntriesPeriod = kwargs.get('appendEntriesPeriod', 0.1) 17 | --- 18 | > self.appendEntriesPeriod = kwargs.get('appendEntriesPeriod', 0.2) 19 | 51c51 20 | < self.connectionRetryTime = kwargs.get('connectionRetryTime', 5.0) 21 | --- 22 | > self.connectionRetryTime = kwargs.get('connectionRetryTime', 0.05) 23 | ``` 24 | 25 | Update [monotonic.py](https://github.com/atdt/monotonic) file to support time interception on OpenBSD. 26 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/pysyncobj/__init__.py: -------------------------------------------------------------------------------- 1 | from .syncobj import SyncObj, SyncObjException, SyncObjConf, replicated, replicated_sync,\ 2 | FAIL_REASON, _COMMAND_TYPE, createJournal, HAS_CRYPTO, SERIALIZER_STATE, SyncObjConsumer, _RAFT_STATE 3 | from .utility import TcpUtility 4 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/pysyncobj/atomic_replace.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import ctypes 4 | 5 | if hasattr(ctypes, 'windll'): # pragma: no cover 6 | CreateTransaction = ctypes.windll.ktmw32.CreateTransaction 7 | CommitTransaction = ctypes.windll.ktmw32.CommitTransaction 8 | MoveFileTransacted = ctypes.windll.kernel32.MoveFileTransactedW 9 | CloseHandle = ctypes.windll.kernel32.CloseHandle 10 | 11 | MOVEFILE_REPLACE_EXISTING = 0x1 12 | MOVEFILE_WRITE_THROUGH = 0x8 13 | 14 | if sys.version_info >= (3, 0): 15 | unicode = str 16 | 17 | def atomicReplace(oldPath, newPath): 18 | if not isinstance(oldPath, unicode): 19 | oldPath = unicode(oldPath, sys.getfilesystemencoding()) 20 | if not isinstance(newPath, unicode): 21 | newPath = unicode(newPath, sys.getfilesystemencoding()) 22 | ta = CreateTransaction(None, 0, 0, 0, 0, 1000, 'atomic_replace') 23 | if ta == -1: 24 | return False 25 | res = MoveFileTransacted(oldPath, newPath, None, None, MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH, ta) 26 | if not res: 27 | CloseHandle(ta) 28 | return False 29 | res = CommitTransaction(ta) 30 | CloseHandle(ta) 31 | return bool(res) 32 | else: 33 | atomicReplace = os.rename 34 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/pysyncobj/encryptor.py: -------------------------------------------------------------------------------- 1 | import base64 2 | try: 3 | import cryptography 4 | from cryptography.fernet import Fernet 5 | from cryptography.hazmat.backends import default_backend 6 | from cryptography.hazmat.primitives import hashes 7 | from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC 8 | HAS_CRYPTO = True 9 | except: 10 | HAS_CRYPTO = False 11 | 12 | SALT = b'\x15%q\xe6\xbb\x02\xa6\xf8\x13q\x90\xcf6+\x1e\xeb' 13 | 14 | def getEncryptor(password): 15 | if not isinstance(password, bytes): 16 | password = bytes(password.encode()) 17 | kdf = PBKDF2HMAC( 18 | algorithm=hashes.SHA256(), 19 | length=32, 20 | salt=SALT, 21 | iterations=100000, 22 | backend=default_backend() 23 | ) 24 | key = base64.urlsafe_b64encode(kdf.derive(password)) 25 | return Fernet(key) 26 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/pysyncobj/fast_queue.py: -------------------------------------------------------------------------------- 1 | try: 2 | import Queue 3 | except ImportError: 4 | import queue as Queue 5 | from collections import deque 6 | import threading 7 | 8 | # According to benchmarks, standard Queue is slow. 9 | # Using FastQueue improves overall performance by ~15% 10 | class FastQueue(object): 11 | def __init__(self, maxSize): 12 | self.__queue = deque() 13 | self.__lock = threading.Lock() 14 | self.__maxSize = maxSize 15 | 16 | def put_nowait(self, value): 17 | with self.__lock: 18 | if len(self.__queue) > self.__maxSize: 19 | raise Queue.Full() 20 | self.__queue.append(value) 21 | 22 | def get_nowait(self): 23 | with self.__lock: 24 | if len(self.__queue) == 0: 25 | raise Queue.Empty() 26 | return self.__queue.popleft() 27 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/pysyncobj/pipe_notifier.py: -------------------------------------------------------------------------------- 1 | import os 2 | import fcntl 3 | import socket 4 | from .poller import POLL_EVENT_TYPE 5 | 6 | 7 | class PipeNotifier(object): 8 | 9 | def __init__(self, poller, callback = None): 10 | self.__callback = callback 11 | self.__pipeR, self.__pipeW = os.pipe() 12 | 13 | flag = fcntl.fcntl(self.__pipeR, fcntl.F_GETFD) 14 | fcntl.fcntl(self.__pipeR, fcntl.F_SETFL, flag | os.O_NONBLOCK) 15 | 16 | flag = fcntl.fcntl(self.__pipeW, fcntl.F_GETFD) 17 | fcntl.fcntl(self.__pipeW, fcntl.F_SETFL, flag | os.O_NONBLOCK) 18 | 19 | poller.subscribe(self.__pipeR, self.__onNewNotification, POLL_EVENT_TYPE.READ) 20 | 21 | def notify(self): 22 | os.write(self.__pipeW, b'o') 23 | 24 | def __onNewNotification(self, descr, eventMask): 25 | try: 26 | while os.read(self.__pipeR, 1024): 27 | pass 28 | except OSError as e: 29 | if e.errno not in (socket.errno.EAGAIN, socket.errno.EWOULDBLOCK): 30 | raise 31 | if self.__callback is not None: 32 | self.__callback() 33 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11-with-pr171/pysyncobj/version.py: -------------------------------------------------------------------------------- 1 | VERSION = '0.3.11' 2 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/README: -------------------------------------------------------------------------------- 1 | Version: https://github.com/bakwc/PySyncObj/releases/tag/0.3.11 2 | 3 | Config changes in config.py: 4 | 5 | ```diff 6 | 28c28 7 | < self.autoTick = kwargs.get('autoTick', True) 8 | --- 9 | > self.autoTick = kwargs.get('autoTick', False) 10 | 36c36 11 | < self.raftMinTimeout = kwargs.get('raftMinTimeout', 0.4) 12 | --- 13 | > self.raftMinTimeout = kwargs.get('raftMinTimeout', 0.7) 14 | 43c43 15 | < self.appendEntriesPeriod = kwargs.get('appendEntriesPeriod', 0.1) 16 | --- 17 | > self.appendEntriesPeriod = kwargs.get('appendEntriesPeriod', 0.2) 18 | 51c51 19 | < self.connectionRetryTime = kwargs.get('connectionRetryTime', 5.0) 20 | --- 21 | > self.connectionRetryTime = kwargs.get('connectionRetryTime', 0.05) 22 | ``` 23 | 24 | Update [monotonic.py](https://github.com/atdt/monotonic) file to support time interception on OpenBSD. 25 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/pysyncobj/__init__.py: -------------------------------------------------------------------------------- 1 | from .syncobj import SyncObj, SyncObjException, SyncObjConf, replicated, replicated_sync,\ 2 | FAIL_REASON, _COMMAND_TYPE, createJournal, HAS_CRYPTO, SERIALIZER_STATE, SyncObjConsumer, _RAFT_STATE 3 | from .utility import TcpUtility 4 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/pysyncobj/atomic_replace.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import ctypes 4 | 5 | if hasattr(ctypes, 'windll'): # pragma: no cover 6 | CreateTransaction = ctypes.windll.ktmw32.CreateTransaction 7 | CommitTransaction = ctypes.windll.ktmw32.CommitTransaction 8 | MoveFileTransacted = ctypes.windll.kernel32.MoveFileTransactedW 9 | CloseHandle = ctypes.windll.kernel32.CloseHandle 10 | 11 | MOVEFILE_REPLACE_EXISTING = 0x1 12 | MOVEFILE_WRITE_THROUGH = 0x8 13 | 14 | if sys.version_info >= (3, 0): 15 | unicode = str 16 | 17 | def atomicReplace(oldPath, newPath): 18 | if not isinstance(oldPath, unicode): 19 | oldPath = unicode(oldPath, sys.getfilesystemencoding()) 20 | if not isinstance(newPath, unicode): 21 | newPath = unicode(newPath, sys.getfilesystemencoding()) 22 | ta = CreateTransaction(None, 0, 0, 0, 0, 1000, 'atomic_replace') 23 | if ta == -1: 24 | return False 25 | res = MoveFileTransacted(oldPath, newPath, None, None, MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH, ta) 26 | if not res: 27 | CloseHandle(ta) 28 | return False 29 | res = CommitTransaction(ta) 30 | CloseHandle(ta) 31 | return bool(res) 32 | else: 33 | atomicReplace = os.rename 34 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/pysyncobj/encryptor.py: -------------------------------------------------------------------------------- 1 | import base64 2 | try: 3 | import cryptography 4 | from cryptography.fernet import Fernet 5 | from cryptography.hazmat.backends import default_backend 6 | from cryptography.hazmat.primitives import hashes 7 | from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC 8 | HAS_CRYPTO = True 9 | except: 10 | HAS_CRYPTO = False 11 | 12 | SALT = b'\x15%q\xe6\xbb\x02\xa6\xf8\x13q\x90\xcf6+\x1e\xeb' 13 | 14 | def getEncryptor(password): 15 | if not isinstance(password, bytes): 16 | password = bytes(password.encode()) 17 | kdf = PBKDF2HMAC( 18 | algorithm=hashes.SHA256(), 19 | length=32, 20 | salt=SALT, 21 | iterations=100000, 22 | backend=default_backend() 23 | ) 24 | key = base64.urlsafe_b64encode(kdf.derive(password)) 25 | return Fernet(key) 26 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/pysyncobj/fast_queue.py: -------------------------------------------------------------------------------- 1 | try: 2 | import Queue 3 | except ImportError: 4 | import queue as Queue 5 | from collections import deque 6 | import threading 7 | 8 | # According to benchmarks, standard Queue is slow. 9 | # Using FastQueue improves overall performance by ~15% 10 | class FastQueue(object): 11 | def __init__(self, maxSize): 12 | self.__queue = deque() 13 | self.__lock = threading.Lock() 14 | self.__maxSize = maxSize 15 | 16 | def put_nowait(self, value): 17 | with self.__lock: 18 | if len(self.__queue) > self.__maxSize: 19 | raise Queue.Full() 20 | self.__queue.append(value) 21 | 22 | def get_nowait(self): 23 | with self.__lock: 24 | if len(self.__queue) == 0: 25 | raise Queue.Empty() 26 | return self.__queue.popleft() 27 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/pysyncobj/pipe_notifier.py: -------------------------------------------------------------------------------- 1 | import os 2 | import fcntl 3 | import socket 4 | from .poller import POLL_EVENT_TYPE 5 | 6 | 7 | class PipeNotifier(object): 8 | 9 | def __init__(self, poller, callback = None): 10 | self.__callback = callback 11 | self.__pipeR, self.__pipeW = os.pipe() 12 | 13 | flag = fcntl.fcntl(self.__pipeR, fcntl.F_GETFD) 14 | fcntl.fcntl(self.__pipeR, fcntl.F_SETFL, flag | os.O_NONBLOCK) 15 | 16 | flag = fcntl.fcntl(self.__pipeW, fcntl.F_GETFD) 17 | fcntl.fcntl(self.__pipeW, fcntl.F_SETFL, flag | os.O_NONBLOCK) 18 | 19 | poller.subscribe(self.__pipeR, self.__onNewNotification, POLL_EVENT_TYPE.READ) 20 | 21 | def notify(self): 22 | os.write(self.__pipeW, b'o') 23 | 24 | def __onNewNotification(self, descr, eventMask): 25 | try: 26 | while os.read(self.__pipeR, 1024): 27 | pass 28 | except OSError as e: 29 | if e.errno not in (socket.errno.EAGAIN, socket.errno.EWOULDBLOCK): 30 | raise 31 | if self.__callback is not None: 32 | self.__callback() 33 | -------------------------------------------------------------------------------- /systems/PySyncObj/pysyncobj-v0.3.11/pysyncobj/version.py: -------------------------------------------------------------------------------- 1 | VERSION = '0.3.11' 2 | -------------------------------------------------------------------------------- /systems/PySyncObj/scripts/env.sh: -------------------------------------------------------------------------------- 1 | source $(dirname "$(realpath "$0")")/../../../scripts/env.sh && export CUR_SCRIPT_DIR=$(eval $(get_dir_cmd)) && export_more -------------------------------------------------------------------------------- /systems/PySyncObj/scripts/mc.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: ../../specs/PySyncObj.tla 3 | model name: ../scripts/model-simulation/mc/mc 4 | workers: 1 5 | workers: SHOW_IN_TABLE 6 | check deadlock: false 7 | memory ratio: 0.3 8 | dump states: dot 9 | stop after: 60 10 | 11 | [behavior] 12 | temporal formula: Spec 13 | 14 | [invariants] 15 | #AtMostOneLeaderPerTerm: AtMostOneLeaderPerTerm 16 | ;TypeOk: TypeOk 17 | #INV: INV 18 | 19 | [state constraint] 20 | #SC: SC 21 | 22 | [constants] 23 | M_NNI: [model value] 24 | M_AE: [model value] 25 | M_RVR: [model value] 26 | M_RV: [model value] 27 | Leader: [model value] 28 | Follower: [model value] 29 | Candidate: [model value] 30 | NoOp: [model value] 31 | Nil: [model value] 32 | Commands: [model value]{v1, v2} 33 | Servers: [model value]{n1, n2, n3} 34 | Parameters: [MaxElectionTimes |-> 3, 35 | MaxAppenEntriesTimes |-> 3, 36 | MaxPartitionTimes |-> 1, 37 | MaxClientOperationsTimes |-> 3, 38 | MaxWireMsgs |-> 6] 39 | #Parameters: <<>> 40 | 41 | ;Parameters: [MaxPartitionTimes |-> 0, MaxElectionTimes |-> 1] 42 | 43 | [override] 44 | InvSequence: <<>> 45 | -------------------------------------------------------------------------------- /systems/PySyncObj/scripts/run_one_testcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source ${RUN_ONE_TESTCASE_COMMON_SH} "$@" -p "$(dirname $1)/pysyncobj" 5 | -------------------------------------------------------------------------------- /systems/PySyncObj/scripts/sim.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: ../../specs/PySyncObj.tla 3 | model name: ../scripts/model-simulation/mc/sim 4 | workers: 1 5 | workers: SHOW_IN_TABLE 6 | #simulation depth: 10 7 | #simulation depth: 30 8 | simulation depth: 50 9 | #simulation depth: 10000 10 | simulation traces: 50 11 | simulation dump traces: true 12 | check deadlock: false 13 | memory ratio: 0.3 14 | 15 | [behavior] 16 | temporal formula: Spec 17 | 18 | [invariants] 19 | #AtMostOneLeaderPerTerm: AtMostOneLeaderPerTerm 20 | ;TypeOk: TypeOk 21 | #INV: INV 22 | 23 | [state constraint] 24 | #SC: SC 25 | 26 | [constants] 27 | M_NNI: [model value] 28 | M_AE: [model value] 29 | M_RVR: [model value] 30 | M_RV: [model value] 31 | Leader: [model value] 32 | Follower: [model value] 33 | Candidate: [model value] 34 | NoOp: [model value] 35 | Nil: [model value] 36 | Commands: [model value]{v1, v2} 37 | Servers: [model value]{n1, n2, n3} 38 | Parameters: [MaxElectionTimes |-> 3, 39 | MaxAppenEntriesTimes |-> 3, 40 | MaxPartitionTimes |-> 1, 41 | MaxClientOperationsTimes |-> 3, 42 | MaxWireMsgs |-> 6] 43 | #Parameters: <<>> 44 | 45 | ;Parameters: [MaxPartitionTimes |-> 0, MaxElectionTimes |-> 1] 46 | 47 | [override] 48 | InvSequence: <<>> 49 | -------------------------------------------------------------------------------- /systems/PySyncObj/scripts/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source $START_DOCKER_COMMON_SH "$@" 5 | 6 | HOST_CMD="$CONTROLLER -detail -config $CONFIG_FILE -tmpdir $TMPDIR -deliver_first_msg; exit" 7 | 8 | cat <{v1, v2} 35 | Servers: [model value]{n1, n2} 36 | Parameters: [MaxElectionTimes |-> 2, 37 | MaxAppenEntriesTimes |-> 3, 38 | MaxClientOperationsTimes |-> 3, 39 | MaxWireMsgs |-> 6, 40 | MaxDuplicate |-> 2, 41 | MaxDrop |-> 2] 42 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/commitment_not_advanced/raftos/raftos/__init__.py: -------------------------------------------------------------------------------- 1 | from .conf import configure, config 2 | from .replicator import Replicated, ReplicatedDict, ReplicatedList 3 | from .server import register, stop 4 | from .state import State 5 | 6 | 7 | __all__ = [ 8 | 'Replicated', 9 | 'ReplicatedDict', 10 | 'ReplicatedList', 11 | 12 | 'config', 13 | 'configure', 14 | 'register', 15 | 'stop', 16 | 17 | 'get_leader', 18 | 'wait_until_leader' 19 | ] 20 | 21 | 22 | get_leader = State.get_leader 23 | wait_until_leader = State.wait_until_leader 24 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/commitment_not_advanced/raftos/raftos/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | class NotALeaderException(Exception): 3 | pass 4 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/commitment_not_advanced/raftos/raftos/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | 4 | logger = logging.getLogger('raftos') 5 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/commitment_not_advanced/raftos/raftos/serializers.py: -------------------------------------------------------------------------------- 1 | import msgpack 2 | 3 | try: 4 | import ujson as json 5 | except ImportError: 6 | import json 7 | 8 | 9 | class JSONSerializer: 10 | @staticmethod 11 | def pack(data): 12 | return json.dumps(data).encode() 13 | 14 | @staticmethod 15 | def unpack(data): 16 | decoded = data.decode() if isinstance(data, bytes) else data 17 | return json.loads(decoded) 18 | 19 | 20 | class MessagePackSerializer: 21 | @staticmethod 22 | def pack(data): 23 | return msgpack.packb(data, use_bin_type=True) 24 | 25 | @staticmethod 26 | def unpack(data): 27 | return msgpack.unpackb(data, use_list=True, encoding='utf-8') 28 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/commitment_not_advanced/raftos/raftos/timer.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | 4 | class Timer: 5 | """Scheduling periodic callbacks""" 6 | def __init__(self, interval, callback): 7 | self.interval = interval 8 | self.callback = callback 9 | self.loop = asyncio.get_event_loop() 10 | 11 | self.is_active = False 12 | 13 | def start(self): 14 | self.is_active = True 15 | self.handler = self.loop.call_later(self.get_interval(), self._run) 16 | 17 | def _run(self): 18 | if self.is_active: 19 | self.callback() 20 | self.handler = self.loop.call_later(self.get_interval(), self._run) 21 | 22 | def stop(self): 23 | self.is_active = False 24 | self.handler.cancel() 25 | 26 | def reset(self): 27 | self.stop() 28 | self.start() 29 | 30 | def get_interval(self): 31 | return self.interval() if callable(self.interval) else self.interval 32 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/incorrect_erasing_entries/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: raftOs.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | ;TypeOk: TypeOk 13 | INV: INV 14 | ElectionSafety: ElectionSafety 15 | LogMatching: LogMatching 16 | NextIdxGtMatchIdx: NextIdxGtMatchIdx 17 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 18 | NextIdxGtZero: NextIdxGtZero 19 | CommitIdxLELogLen: CommitIdxLELogLen 20 | 21 | [state constraint] 22 | SC: SC 23 | 24 | [constants] 25 | AER: [model value] 26 | AE: [model value] 27 | RV: [model value] 28 | RVR: [model value] 29 | Leader: [model value] 30 | Follower: [model value] 31 | Candidate: [model value] 32 | NoOp: [model value] 33 | Nil: [model value] 34 | Commands: [model value]{v1, v2} 35 | Servers: [model value]{n1, n2} 36 | Parameters: [MaxElectionTimes |-> 2, 37 | MaxAppenEntriesTimes |-> 3, 38 | MaxClientOperationsTimes |-> 3, 39 | MaxWireMsgs |-> 6, 40 | MaxDuplicate |-> 2, 41 | MaxDrop |-> 2] 42 | 43 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/incorrect_erasing_entries/raftos/raftos/__init__.py: -------------------------------------------------------------------------------- 1 | from .conf import configure, config 2 | from .replicator import Replicated, ReplicatedDict, ReplicatedList 3 | from .server import register, stop 4 | from .state import State 5 | 6 | 7 | __all__ = [ 8 | 'Replicated', 9 | 'ReplicatedDict', 10 | 'ReplicatedList', 11 | 12 | 'config', 13 | 'configure', 14 | 'register', 15 | 'stop', 16 | 17 | 'get_leader', 18 | 'wait_until_leader' 19 | ] 20 | 21 | 22 | get_leader = State.get_leader 23 | wait_until_leader = State.wait_until_leader 24 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/incorrect_erasing_entries/raftos/raftos/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | class NotALeaderException(Exception): 3 | pass 4 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/incorrect_erasing_entries/raftos/raftos/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | 4 | logger = logging.getLogger('raftos') 5 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/incorrect_erasing_entries/raftos/raftos/serializers.py: -------------------------------------------------------------------------------- 1 | import msgpack 2 | 3 | try: 4 | import ujson as json 5 | except ImportError: 6 | import json 7 | 8 | 9 | class JSONSerializer: 10 | @staticmethod 11 | def pack(data): 12 | return json.dumps(data).encode() 13 | 14 | @staticmethod 15 | def unpack(data): 16 | decoded = data.decode() if isinstance(data, bytes) else data 17 | return json.loads(decoded) 18 | 19 | 20 | class MessagePackSerializer: 21 | @staticmethod 22 | def pack(data): 23 | return msgpack.packb(data, use_bin_type=True) 24 | 25 | @staticmethod 26 | def unpack(data): 27 | return msgpack.unpackb(data, use_list=True, encoding='utf-8') 28 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/incorrect_erasing_entries/raftos/raftos/timer.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | 4 | class Timer: 5 | """Scheduling periodic callbacks""" 6 | def __init__(self, interval, callback): 7 | self.interval = interval 8 | self.callback = callback 9 | self.loop = asyncio.get_event_loop() 10 | 11 | self.is_active = False 12 | 13 | def start(self): 14 | self.is_active = True 15 | self.handler = self.loop.call_later(self.get_interval(), self._run) 16 | 17 | def _run(self): 18 | if self.is_active: 19 | self.callback() 20 | self.handler = self.loop.call_later(self.get_interval(), self._run) 21 | 22 | def stop(self): 23 | self.is_active = False 24 | self.handler.cancel() 25 | 26 | def reset(self): 27 | self.stop() 28 | self.start() 29 | 30 | def get_interval(self): 31 | return self.interval() if callable(self.interval) else self.interval 32 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/non_monotonic_match_idx/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: raftOs.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | ;TypeOk: TypeOk 13 | INV: INV 14 | ElectionSafety: ElectionSafety 15 | LogMatching: LogMatching 16 | NextIdxGtMatchIdx: NextIdxGtMatchIdx 17 | NextIdxGtZero: NextIdxGtZero 18 | CommitIdxLELogLen: CommitIdxLELogLen 19 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 20 | 21 | [state constraint] 22 | SC: SC 23 | 24 | [constants] 25 | AER: [model value] 26 | AE: [model value] 27 | RV: [model value] 28 | RVR: [model value] 29 | Leader: [model value] 30 | Follower: [model value] 31 | Candidate: [model value] 32 | NoOp: [model value] 33 | Nil: [model value] 34 | Commands: [model value]{v1, v2} 35 | Servers: [model value]{n1, n2} 36 | Parameters: [MaxElectionTimes |-> 2, 37 | MaxAppenEntriesTimes |-> 3, 38 | MaxClientOperationsTimes |-> 3, 39 | MaxWireMsgs |-> 6, 40 | MaxDuplicate |-> 2, 41 | MaxDrop |-> 2] 42 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/non_monotonic_match_idx/raftos/raftos/__init__.py: -------------------------------------------------------------------------------- 1 | from .conf import configure, config 2 | from .replicator import Replicated, ReplicatedDict, ReplicatedList 3 | from .server import register, stop 4 | from .state import State 5 | 6 | 7 | __all__ = [ 8 | 'Replicated', 9 | 'ReplicatedDict', 10 | 'ReplicatedList', 11 | 12 | 'config', 13 | 'configure', 14 | 'register', 15 | 'stop', 16 | 17 | 'get_leader', 18 | 'wait_until_leader' 19 | ] 20 | 21 | 22 | get_leader = State.get_leader 23 | wait_until_leader = State.wait_until_leader 24 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/non_monotonic_match_idx/raftos/raftos/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | class NotALeaderException(Exception): 3 | pass 4 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/non_monotonic_match_idx/raftos/raftos/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | 4 | logger = logging.getLogger('raftos') 5 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/non_monotonic_match_idx/raftos/raftos/serializers.py: -------------------------------------------------------------------------------- 1 | import msgpack 2 | 3 | try: 4 | import ujson as json 5 | except ImportError: 6 | import json 7 | 8 | 9 | class JSONSerializer: 10 | @staticmethod 11 | def pack(data): 12 | return json.dumps(data).encode() 13 | 14 | @staticmethod 15 | def unpack(data): 16 | decoded = data.decode() if isinstance(data, bytes) else data 17 | return json.loads(decoded) 18 | 19 | 20 | class MessagePackSerializer: 21 | @staticmethod 22 | def pack(data): 23 | return msgpack.packb(data, use_bin_type=True) 24 | 25 | @staticmethod 26 | def unpack(data): 27 | return msgpack.unpackb(data, use_list=True, encoding='utf-8') 28 | -------------------------------------------------------------------------------- /systems/RaftOS/bugs/non_monotonic_match_idx/raftos/raftos/timer.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | 4 | class Timer: 5 | """Scheduling periodic callbacks""" 6 | def __init__(self, interval, callback): 7 | self.interval = interval 8 | self.callback = callback 9 | self.loop = asyncio.get_event_loop() 10 | 11 | self.is_active = False 12 | 13 | def start(self): 14 | self.is_active = True 15 | self.handler = self.loop.call_later(self.get_interval(), self._run) 16 | 17 | def _run(self): 18 | if self.is_active: 19 | self.callback() 20 | self.handler = self.loop.call_later(self.get_interval(), self._run) 21 | 22 | def stop(self): 23 | self.is_active = False 24 | self.handler.cancel() 25 | 26 | def reset(self): 27 | self.stop() 28 | self.start() 29 | 30 | def get_interval(self): 31 | return self.interval() if callable(self.interval) else self.interval 32 | -------------------------------------------------------------------------------- /systems/RaftOS/raftos/raftos/__init__.py: -------------------------------------------------------------------------------- 1 | from .conf import configure, config 2 | from .replicator import Replicated, ReplicatedDict, ReplicatedList 3 | from .server import register, stop 4 | from .state import State 5 | 6 | 7 | __all__ = [ 8 | 'Replicated', 9 | 'ReplicatedDict', 10 | 'ReplicatedList', 11 | 12 | 'config', 13 | 'configure', 14 | 'register', 15 | 'stop', 16 | 17 | 'get_leader', 18 | 'wait_until_leader' 19 | ] 20 | 21 | 22 | get_leader = State.get_leader 23 | wait_until_leader = State.wait_until_leader 24 | -------------------------------------------------------------------------------- /systems/RaftOS/raftos/raftos/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | class NotALeaderException(Exception): 3 | pass 4 | -------------------------------------------------------------------------------- /systems/RaftOS/raftos/raftos/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | 4 | logger = logging.getLogger('raftos') 5 | -------------------------------------------------------------------------------- /systems/RaftOS/raftos/raftos/serializers.py: -------------------------------------------------------------------------------- 1 | import msgpack 2 | 3 | try: 4 | import ujson as json 5 | except ImportError: 6 | import json 7 | 8 | 9 | class JSONSerializer: 10 | @staticmethod 11 | def pack(data): 12 | return json.dumps(data).encode() 13 | 14 | @staticmethod 15 | def unpack(data): 16 | decoded = data.decode() if isinstance(data, bytes) else data 17 | return json.loads(decoded) 18 | 19 | 20 | class MessagePackSerializer: 21 | @staticmethod 22 | def pack(data): 23 | return msgpack.packb(data, use_bin_type=True) 24 | 25 | @staticmethod 26 | def unpack(data): 27 | return msgpack.unpackb(data, use_list=True, encoding='utf-8') 28 | -------------------------------------------------------------------------------- /systems/RaftOS/raftos/raftos/timer.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | 4 | class Timer: 5 | """Scheduling periodic callbacks""" 6 | def __init__(self, interval, callback): 7 | self.interval = interval 8 | self.callback = callback 9 | self.loop = asyncio.get_event_loop() 10 | 11 | self.is_active = False 12 | 13 | def start(self): 14 | self.is_active = True 15 | self.handler = self.loop.call_later(self.get_interval(), self._run) 16 | 17 | def _run(self): 18 | if self.is_active: 19 | self.callback() 20 | self.handler = self.loop.call_later(self.get_interval(), self._run) 21 | 22 | def stop(self): 23 | self.is_active = False 24 | self.handler.cancel() 25 | 26 | def reset(self): 27 | self.stop() 28 | self.start() 29 | 30 | def get_interval(self): 31 | return self.interval() if callable(self.interval) else self.interval 32 | -------------------------------------------------------------------------------- /systems/RaftOS/raftos/venv.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/RaftOS/raftos/venv.tar.gz -------------------------------------------------------------------------------- /systems/RaftOS/scripts/env.sh: -------------------------------------------------------------------------------- 1 | source $(dirname "$(realpath "$0")")/../../../scripts/env.sh && export CUR_SCRIPT_DIR=$(eval $(get_dir_cmd)) && export_more -------------------------------------------------------------------------------- /systems/RaftOS/scripts/run_one_testcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source ${RUN_ONE_TESTCASE_COMMON_SH} "$@" -p "$(dirname $1)/raftos" 5 | -------------------------------------------------------------------------------- /systems/RaftOS/scripts/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source $START_DOCKER_COMMON_SH "$@" 5 | 6 | HOST_CMD="$CONTROLLER -detail -config $CONFIG_FILE -tmpdir $TMPDIR -udp; exit" 7 | 8 | cat <> "$GEN_FILE" 7 | option udp 8 | EOF -------------------------------------------------------------------------------- /systems/WRaft-series/DaosRaft/bugs/leader_votes_for_others/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: DaosRaft.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | INV: INV 13 | ElectionSafety: ElectionSafety 14 | LogMatching: LogMatching 15 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 16 | NextIdxGtMatchIdx: NextIdxGtMatchIdx 17 | NextIdxGtZero: NextIdxGtZero 18 | CommitIdxLELogLen: CommitIdxLELogLen 19 | LeaderTermLogHasGreatestIdx: LeaderTermLogHasGreatestIdx 20 | VoteAssertions: VoteAssertions 21 | 22 | [state constraint] 23 | SC: SC 24 | 25 | [constants] 26 | M_AER: [model value] 27 | M_AE: [model value] 28 | M_RVR: [model value] 29 | M_RV: [model value] 30 | Leader: [model value] 31 | Follower: [model value] 32 | PreCandidate: [model value] 33 | Candidate: [model value] 34 | NoOp: [model value] 35 | Nil: [model value] 36 | Commands: [model value]{v1, v2} 37 | Servers: [model value]{n1, n2} 38 | Parameters:[ MaxElectionTimes |-> 2, 39 | MaxAppendEntriesTimes |-> 3, 40 | MaxPartitionTimes |-> 1, 41 | MaxClientOperationsTimes |-> 3, 42 | MaxWireMsgs |-> 6 ] 43 | -------------------------------------------------------------------------------- /systems/WRaft-series/DaosRaft/scripts/env.sh: -------------------------------------------------------------------------------- 1 | source $(dirname "$(realpath "$0")")/../../../../scripts/env.sh && export CUR_SCRIPT_DIR=$(eval $(get_dir_cmd)) && export_more -------------------------------------------------------------------------------- /systems/WRaft-series/DaosRaft/scripts/run_one_testcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source ${RUN_ONE_TESTCASE_COMMON_SH} "$@" 5 | -------------------------------------------------------------------------------- /systems/WRaft-series/DaosRaft/scripts/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source $START_DOCKER_COMMON_SH "$@" 5 | 6 | CLIENT=$SANDTABLE_BUILD_DIR/drivers/DaosRaftDriver 7 | 8 | HOST_CMD="$CONTROLLER -detail -config $CONFIG_FILE -tmpdir $TMPDIR; exit" 9 | 10 | cat <> "$GEN_FILE" 7 | option partition_keep_msgs 8 | option allow_msg_unordered 9 | EOF -------------------------------------------------------------------------------- /systems/WRaft-series/driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(raftdriver) 3 | 4 | set(CMAKE_CXX_STANDARD 20) 5 | add_compile_options(-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-function) 6 | 7 | add_subdirectory(deps/WRaft EXCLUDE_FROM_ALL) 8 | add_subdirectory(deps/RedisRaft EXCLUDE_FROM_ALL) 9 | add_subdirectory(deps/DaosRaft EXCLUDE_FROM_ALL) 10 | add_subdirectory(tlpi EXCLUDE_FROM_ALL) 11 | 12 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") 15 | 16 | find_package(gflags REQUIRED) 17 | find_package(Readline REQUIRED) 18 | 19 | set(DRIVER_SOURCES main.cpp Network.cpp Network.h Config.cpp Config.h Repl.cpp Repl.h Raft.h common.h common.cpp Node.cpp Node.h TcpNetwork.cpp TcpNetwork.h) 20 | 21 | macro(define_driver name) 22 | add_executable(${name}Driver deps/${name}.cpp ${DRIVER_SOURCES}) 23 | target_link_libraries(${name}Driver ${name} readline gflags tlpi) 24 | endmacro() 25 | 26 | define_driver(WRaft) 27 | define_driver(RedisRaft) 28 | define_driver(DaosRaft) 29 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/Node.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 2/21/23. 3 | // 4 | 5 | #ifndef REDISTMET_NODE_H 6 | #define REDISTMET_NODE_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include "common.h" 12 | 13 | using namespace std; 14 | 15 | #define NODE_PREFIX "n" 16 | 17 | struct Node { 18 | string name; 19 | struct sockaddr_in addr; 20 | int id = -1; 21 | void *data = nullptr; 22 | Node() = default; 23 | Node(string name_, const struct sockaddr_in &addr_): name{std::move(name_)}, addr{addr_} { getid(); } 24 | Node(string name_): name{std::move(name_)}, addr{} { getid(); } 25 | Node(const struct sockaddr_in &addr_): addr{addr_} {} 26 | Node(int id_): addr{}, id{id_} { name = NODE_PREFIX + std::to_string(id); } 27 | bool operator<(const struct Node& b) const; // less 28 | bool operator<(const string& b) const; 29 | bool operator<(const struct sockaddr_in& b) const; 30 | [[nodiscard]] string gethost() const; 31 | [[nodiscard]] string getport() const; 32 | [[nodiscard]] string to_string() const; 33 | int getid(); 34 | void set_data(void *d) { data = d; } 35 | [[nodiscard]] void* get_data() const { return data; } 36 | }; 37 | 38 | #endif //REDISTMET_NODE_H 39 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/Raft.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 2/14/23. 3 | // 4 | 5 | #ifndef REDISTMET_RAFT_H 6 | #define REDISTMET_RAFT_H 7 | 8 | #include "common.h" 9 | 10 | bool RaftRepl(const string &cmd); 11 | string RaftGet(const string &variable); 12 | 13 | #endif //REDISTMET_RAFT_H 14 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/Repl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 2/14/23. 3 | // 4 | 5 | #ifndef REDISTMET_REPL_H 6 | #define REDISTMET_REPL_H 7 | 8 | #include 9 | 10 | using namespace std; 11 | 12 | class Repl { 13 | private: 14 | const char *prompt = "\033[1;36m" "(REPL) " "\033[0m"; 15 | const char *ok_str = "\033[1;32m" "[OK]" "\033[0m"; // bold green 16 | const char *fail_str = "\033[1;31m" "[FAIL]" "\033[0m"; // bold red 17 | // int interceptor_fd = 1022; 18 | int interceptor_fd = 126; 19 | void check_interceptor_fd(); 20 | void ack(const string &data) const; 21 | public: 22 | Repl(); 23 | void readline(); 24 | bool getinfo(const string &cmd); 25 | }; 26 | 27 | 28 | #endif //REDISTMET_REPL_H 29 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/TcpNetwork.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by tangruize on 2/23/23. 3 | // 4 | 5 | #ifndef REDISTMET_TCPNETWORK_H 6 | #define REDISTMET_TCPNETWORK_H 7 | 8 | #include "common.h" 9 | #include "Network.h" 10 | 11 | class TcpNetwork: public Network { 12 | private: 13 | socklen_t addrlen; 14 | public: 15 | explicit TcpNetwork(bool run_accept=true); 16 | int accept(); 17 | void accept_loop(); 18 | void accept_in_background(); 19 | static bool is_connected(int fd); 20 | bool connect(const Node &n) override; 21 | void connect_all() override; 22 | bool is_all_connected() override; 23 | ssize_t send_to(const Node &peer, const string &data) override; 24 | ssize_t recv_from(const Node &peer, string &data) override; 25 | }; 26 | 27 | 28 | #endif //REDISTMET_TCPNETWORK_H 29 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/cmake/FindReadline.cmake: -------------------------------------------------------------------------------- 1 | find_path(Readline_INCLUDE_DIR 2 | NAMES readline/readline.h) 3 | 4 | find_library(Readline_LIBRARY 5 | NAMES readline) 6 | 7 | mark_as_advanced( 8 | Readline_INCLUDE_DIR 9 | Readline_LIBRARY 10 | ) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(Readline 14 | DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY) 15 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Have Release Engineering added as a reviewer to any packaging PR 2 | * @daos-stack/build-and-release-watchers 3 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.gcno 3 | *.gcda 4 | tests/main_test.c 5 | tests_main 6 | raft_server.c.gcov 7 | *~ 8 | libcraft.so 9 | libcraft.a 10 | _topdir/ 11 | *.tar.* 12 | *.code-workspace 13 | mock -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | before_install: 3 | - sudo pip install cpp-coveralls 4 | script: 5 | - make tests 6 | after_success: 7 | - coveralls --verbose --exclude include --exclude tests --exclude CLinkedListQueue 8 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Library build : 2 | # mkdir build && cd build && cmake .. 3 | # make 4 | 5 | cmake_minimum_required(VERSION 3.7.2) 6 | 7 | project(DaosRaft C) 8 | 9 | # ----------------------- Build Settings Start ------------------------------- # 10 | set(CMAKE_C_STANDARD 99) 11 | set(CMAKE_C_STANDARD_REQUIRED ON) 12 | set(CMAKE_C_EXTENSIONS OFF) 13 | # ------------------------ Build Settings End -------------------------------- # 14 | 15 | # ----------------------------- C Tests Start -------------------------------- # 16 | 17 | set(RAFT_SOURCE_FILES 18 | src/raft_log.c 19 | src/raft_server.c 20 | src/raft_node.c 21 | src/raft_server_properties.c) 22 | 23 | add_library(DaosRaft STATIC ${RAFT_SOURCE_FILES}) 24 | target_compile_options(DaosRaft PRIVATE -g -Wall -Wextra) 25 | target_include_directories(DaosRaft PRIVATE include) 26 | 27 | add_library(DaosRaft_shared SHARED ${RAFT_SOURCE_FILES}) 28 | target_include_directories(DaosRaft_shared PRIVATE include) 29 | set_property(TARGET DaosRaft_shared PROPERTY POSITION_INDEPENDENT_CODE ON) 30 | target_compile_options(DaosRaft_shared PRIVATE -g -Wall -Wextra) 31 | # ------------------------------ C Tests End --------------------------------- # 32 | 33 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/Makefile-rpm.mk: -------------------------------------------------------------------------------- 1 | NAME := raft 2 | SRC_EXT := gz 3 | 4 | GIT_SHA1 := $(shell git rev-parse HEAD) 5 | GIT_SHORT := $(shell git rev-parse --short HEAD) 6 | GIT_NUM_COMMITS := $(shell git rev-list HEAD --count) 7 | 8 | GIT_INFO := $(GIT_NUM_COMMITS).g$(GIT_SHORT) 9 | 10 | BUILD_DEFINES := --define "relval .$(GIT_INFO)" 11 | RPM_BUILD_OPTIONS := $(BUILD_DEFINES) 12 | 13 | include packaging/Makefile_packaging.mk 14 | 15 | $(NAME)-$(VERSION).tar.gz: 16 | git archive --format tar --prefix $(NAME)-$(VERSION)/ HEAD | gzip > $@ 17 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | SConscript('src/SConscript', exports = 'env') 3 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/contrib/CLinkedListQueue/Makefile: -------------------------------------------------------------------------------- 1 | GCOV_OUTPUT = *.gcda *.gcno *.gcov 2 | GCOV_CCFLAGS = -fprofile-arcs -ftest-coverage 3 | CC = gcc 4 | CCFLAGS = -I. -Itests -g -O2 -Wall -Werror -W -fno-omit-frame-pointer -fno-common -fsigned-char $(GCOV_CCFLAGS) 5 | 6 | all: test 7 | 8 | main.c: 9 | sh tests/make-tests.sh tests/test_*.c > main.c 10 | 11 | test: main.c linked_list_queue.o tests/test_linked_list_queue.c tests/CuTest.c main.c 12 | $(CC) $(CCFLAGS) -o $@ $^ 13 | ./test 14 | gcov main.c linked_list_queue.c 15 | 16 | linked_list_queue.o: linked_list_queue.c 17 | $(CC) $(CCFLAGS) -c -o $@ $^ 18 | 19 | clean: 20 | rm -f main.c linked_list_queue.o test $(GCOV_OUTPUT) 21 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/contrib/CLinkedListQueue/README.md: -------------------------------------------------------------------------------- 1 | # How does it work? 2 | 3 | ```c 4 | 5 | char* obj = strdup("test"); 6 | 7 | void *q = llqueue_new(); 8 | 9 | llqueue_offer(q, obj); 10 | 11 | printf("object from queue: %s\n", llqueue_poll(q)); 12 | 13 | ``` 14 | 15 | # Building 16 | $make 17 | 18 | # Todo 19 | 20 | - Make lockfree variant using CAS 21 | 22 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/contrib/CLinkedListQueue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "linked-list-queue", 3 | "version": "0.0.1", 4 | "repo": "willemt/linked-list-queue", 5 | "description": "A queue using a linked list", 6 | "keywords": ["queue"], 7 | "license": "BSD", 8 | "src": ["linked_list_queue.c", "linked_list_queue.h"] 9 | } 10 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/contrib/CLinkedListQueue/tests/make-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Auto generate single AllTests file for CuTest. 4 | # Searches through all *.c files in the current directory. 5 | # Prints to stdout. 6 | # Author: Asim Jalis 7 | # Date: 01/08/2003 8 | 9 | FILES=$1 10 | 11 | #if test $# -eq 0 ; then FILES=*.c ; else FILES=$* ; fi 12 | 13 | echo ' 14 | 15 | /* This is auto-generated code. Edit at your own peril. */ 16 | #include 17 | #include "CuTest.h" 18 | 19 | ' 20 | 21 | cat $FILES | grep '^void Test' | 22 | sed -e 's/(.*$//' \ 23 | -e 's/$/(CuTest*);/' \ 24 | -e 's/^/extern /' 25 | 26 | echo \ 27 | ' 28 | 29 | void RunAllTests(void) 30 | { 31 | CuString *output = CuStringNew(); 32 | CuSuite* suite = CuSuiteNew(); 33 | 34 | ' 35 | cat $FILES | grep '^void Test' | 36 | sed -e 's/^void //' \ 37 | -e 's/(.*$//' \ 38 | -e 's/^/ SUITE_ADD_TEST(suite, /' \ 39 | -e 's/$/);/' 40 | 41 | echo \ 42 | ' 43 | CuSuiteRun(suite); 44 | CuSuiteSummary(suite, output); 45 | CuSuiteDetails(suite, output); 46 | printf("%s\\n", output->buffer); 47 | } 48 | 49 | int main() 50 | { 51 | RunAllTests(); 52 | return 0; 53 | } 54 | ' 55 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/libraft-dev.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | usr/include 3 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/libraft-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/libraft0.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/libraft0.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/lib*.so 2 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/raft-docs.docs: -------------------------------------------------------------------------------- 1 | README.Debian 2 | README.source 3 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | name := raft 17 | prefix := /usr 18 | includedir := $(prefix)/include 19 | libdir := $(prefix)/lib/$(DEB_BUILD_MULTIARCH) 20 | buildroot := debian/tmp 21 | install_includedir := $(buildroot)$(includedir) 22 | install_libdir := $(buildroot)$(libdir) 23 | 24 | 25 | 26 | %: 27 | dh $@ 28 | 29 | override_dh_auto_install: 30 | mkdir -p $(install_libdir) 31 | mkdir -p $(install_includedir) 32 | cp libraft.so $(install_libdir) 33 | cp include/* $(install_includedir) 34 | 35 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/include/raft_types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RAFT_DEFS_H_ 3 | #define RAFT_DEFS_H_ 4 | 5 | #include 6 | 7 | /** 8 | * Unique entry ids are mostly used for debugging and nothing else, 9 | * so there is little harm if they collide. 10 | */ 11 | typedef int raft_entry_id_t; 12 | 13 | /** 14 | * Monotonic term counter. 15 | */ 16 | typedef long int raft_term_t; 17 | 18 | /** 19 | * Monotonic log entry index. 20 | * 21 | * This is also used to as an entry count size type. 22 | */ 23 | typedef long int raft_index_t; 24 | 25 | /** 26 | * Unique node identifier. 27 | */ 28 | typedef int raft_node_id_t; 29 | 30 | #endif /* RAFT_DEFS_H_ */ 31 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raft", 3 | "version": "0.2.0", 4 | "repo": "willemt/raft", 5 | "description": "C implementation of the Raft Consensus protocol, BSD licensed", 6 | "keywords": ["raft", "consensus", "protocol"], 7 | "src": [ 8 | "include/raft.h", 9 | "include/raft_log.h", 10 | "include/raft_private.h", 11 | "src/raft_log.c", 12 | "src/raft_node.c", 13 | "src/raft_server.c", 14 | "src/raft_server_properties.c" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/packaging/Dockerfile.centos.7: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2018-2022, Intel Corporation 3 | # 4 | # 'recipe' for Docker to build an RPM 5 | # 6 | 7 | # Pull base image 8 | FROM centos:7 9 | LABEL maintainer="daos@daos.groups.io" 10 | 11 | # use same UID as host and default value of 1000 if not specified 12 | ARG UID=1000 13 | 14 | # Update distribution 15 | #Nothing to do for CentOS 16 | 17 | # Install basic tools 18 | RUN yum install -y epel-release 19 | RUN yum install -y mock make rpm-build curl createrepo rpmlint redhat-lsb-core \ 20 | git python-srpm-macros dnf 21 | 22 | # Add build user (to keep rpmbuild happy) 23 | ENV USER build 24 | ENV PASSWD build 25 | RUN useradd -u $UID -ms /bin/bash $USER 26 | RUN echo "$USER:$PASSWD" | chpasswd 27 | # add the user to the mock group so it can run mock 28 | RUN usermod -a -G mock $USER 29 | 30 | # mock in Docker needs to use the old-chroot option 31 | RUN grep use_nspawn /etc/mock/site-defaults.cfg || \ 32 | echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg 33 | 34 | RUN chmod g+w /etc/mock/default.cfg 35 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/packaging/Dockerfile.coverity: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2018-2020, Intel Corporation 3 | # 4 | # 'recipe' for Docker to build for a Coverity scan. 5 | # 6 | 7 | # Pull base image 8 | FROM fedora:latest 9 | MAINTAINER daos-stack 10 | 11 | # use same UID as host and default value of 1000 if not specified 12 | ARG UID=1000 13 | 14 | # Install basic tools 15 | RUN dnf -y install mock make rpm-build curl createrepo rpmlint redhat-lsb-core \ 16 | git python-srpm-macros rpmdevtools 17 | RUN dnf -y makecache && dnf -y install gcc 18 | 19 | # Add build user (to keep rpmbuild happy) 20 | ENV USER build 21 | ENV PASSWD build 22 | RUN useradd -u $UID -ms /bin/bash $USER 23 | RUN echo "$USER:$PASSWD" | chpasswd 24 | # add the user to the mock group so it can run mock 25 | RUN usermod -a -G mock $USER 26 | 27 | # mock in Docker needs to use the old-chroot option 28 | RUN grep use_nspawn || \ 29 | echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg 30 | 31 | RUN chmod g+w /etc/mock/* 32 | 33 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/packaging/Dockerfile.ubuntu.rolling: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2019, Intel Corporation 3 | # 4 | # 'recipe' for Docker to build an Debian package 5 | # 6 | # Pull base image 7 | FROM ubuntu:rolling 8 | Maintainer daos-stack 9 | 10 | # use same UID as host and default value of 1000 if not specified 11 | ARG UID=1000 12 | 13 | # Install basic tools 14 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ 15 | autoconf bash curl debhelper dh-make dpkg-dev doxygen gcc \ 16 | git git-buildpackage locales make patch pbuilder rpm wget 17 | 18 | # Add build user (to keep chrootbuild happy) 19 | ENV USER build 20 | RUN useradd -u $UID -ms /bin/bash $USER 21 | 22 | # need to run the build command as root, as it needs to chroot 23 | RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then \ 24 | echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \ 25 | fi; \ 26 | echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" > /etc/sudoers.d/build; \ 27 | chmod 0440 /etc/sudoers.d/build; \ 28 | visudo -c; \ 29 | sudo -l -U build 30 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/raft.rpmlintrc: -------------------------------------------------------------------------------- 1 | # This line is mandatory to access the configuration functions 2 | from Config import * 3 | 4 | # we want the static lib in this case 5 | addFilter('raft-devel.x86_64: E: static-library-without-debuginfo /usr/lib64/libraft.a') 6 | addFilter('raft.x86_64: E: no-binary') 7 | addFilter('name-repeated-in-summary Raft') 8 | # https://github.com/rpm-software-management/rpmlint/issues/856 9 | addFilter('W: incoherent-version-in-changelog') -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/scripts/amalgamate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create amalgamated source file, prints to stdout 4 | 5 | echo '/* 6 | 7 | This source file is the amalgamated version of the original. 8 | Please see github.com/willemt/raft for the original version. 9 | ' 10 | git log | head -n1 | sed 's/commit/HEAD commit:/g' 11 | echo ' 12 | ' 13 | cat LICENSE 14 | echo ' 15 | */ 16 | ' 17 | 18 | echo ' 19 | #ifndef RAFT_AMALGAMATION_SH 20 | #define RAFT_AMALGAMATION_SH 21 | ' 22 | 23 | cat include/raft.h 24 | cat include/raft_*.h 25 | cat src/raft*.c | sed 's/#include "raft.*.h"//g' | sed 's/__/__raft__/g' 26 | 27 | echo '#endif /* RAFT_AMALGAMATIONE_SH */' 28 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/src/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | env = env.Clone() 3 | env.AppendUnique(CPPPATH = ['../include']) 4 | topdir = env.Dir("#").abspath 5 | builddir = env.Dir('.').abspath 6 | libraft = env.Command('libraft.a', '', 'make -C src/rdb/raft/ BUILDDIR=%s GCOV_CCFLAGS= static' % builddir) 7 | test_main = env.Command('tests_main', libraft, 'make -C src/rdb/raft/ BUILDDIR=%s GCOV_CCFLAGS= tests_main' % builddir) 8 | # even though these are AlwaysBuild() they are still inexpensive as the 9 | # make to build them will bail out if they don't actually need rebuilding 10 | AlwaysBuild(libraft) 11 | AlwaysBuild(test_main) 12 | 13 | def CleanAction(env, action): 14 | if env.GetOption('clean'): 15 | env.Execute(action) 16 | 17 | env.AddMethod(CleanAction, 'CleanAction') 18 | 19 | env.CleanAction(Action(['make -C %s/src/rdb/raft/ BUILDDIR=%s clean' % (topdir, builddir)])) 20 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/tests/make-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Auto generate single AllTests file for CuTest. 4 | # Searches through all *.c files in the current directory. 5 | # Prints to stdout. 6 | # Author: Asim Jalis 7 | # Date: 01/08/2003 8 | 9 | FILES=*.c 10 | 11 | #if test $# -eq 0 ; then FILES=*.c ; else FILES=$* ; fi 12 | 13 | echo ' 14 | 15 | /* This is auto-generated code. Edit at your own peril. */ 16 | #include 17 | #include "CuTest.h" 18 | 19 | ' 20 | 21 | cat $FILES | grep '^void Test' | 22 | sed -e 's/(.*$//' \ 23 | -e 's/$/(CuTest*);/' \ 24 | -e 's/^/extern /' 25 | 26 | echo \ 27 | ' 28 | 29 | int RunAllTests(void) 30 | { 31 | CuString *output = CuStringNew(); 32 | CuSuite* suite = CuSuiteNew(); 33 | 34 | ' 35 | cat $FILES | grep '^void Test' | 36 | sed -e 's/^void //' \ 37 | -e 's/(.*$//' \ 38 | -e 's/^/ SUITE_ADD_TEST(suite, /' \ 39 | -e 's/$/);/' 40 | 41 | echo \ 42 | ' 43 | CuSuiteRun(suite); 44 | CuSuiteDetails(suite, output); 45 | printf("%s\\n", output->buffer); 46 | return suite->failCount == 0 ? 0 : 1; 47 | } 48 | 49 | int main() 50 | { 51 | return RunAllTests(); 52 | } 53 | ' 54 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/DaosRaft/tests/test_node.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "CuTest.h" 8 | 9 | #include "raft.h" 10 | #include "raft_log.h" 11 | #include "raft_private.h" 12 | 13 | void TestRaft_is_voting_by_default(CuTest * tc) 14 | { 15 | raft_node_t *p = raft_node_new((void*)1, 1); 16 | CuAssertTrue(tc, raft_node_is_voting(p)); 17 | raft_node_free(p); 18 | } 19 | 20 | void TestRaft_node_set_nextIdx(CuTest * tc) 21 | { 22 | raft_node_t *p = raft_node_new((void*)1, 1); 23 | raft_node_set_next_idx(p, 3); 24 | CuAssertTrue(tc, 3 == raft_node_get_next_idx(p)); 25 | raft_node_free(p); 26 | } 27 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | run-tests: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Set up Python for testing 11 | uses: actions/setup-python@v1 12 | with: 13 | python-version: '3.9' 14 | architecture: 'x64' 15 | - name: Install Python dependencies 16 | run: 17 | python -m pip install -r tests/requirements.txt 18 | - name: Build 19 | run: make COVERAGE=1 20 | - name: Run tests 21 | run: | 22 | make tests 23 | make test_fuzzer 24 | make test_virtraft 25 | make gcov 26 | - name: Upload to codecov 27 | uses: codecov/codecov-action@v2 28 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/.github/workflows/daily.yml: -------------------------------------------------------------------------------- 1 | name: Daily 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | run-tests: 10 | if: github.repository == 'redislabs/raft' 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: make 15 | run: make 16 | - name: Set up Python for testing 17 | uses: actions/setup-python@v1 18 | with: 19 | python-version: '3.9' 20 | architecture: 'x64' 21 | - name: Install Python dependencies 22 | run: 23 | python -m pip install -r tests/requirements.txt 24 | - name: Run tests 25 | run: 26 | make tests_full 27 | - name: Upload to codecov 28 | uses: codecov/codecov-action@v2 29 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.gcno 4 | *.gcda 5 | *.gcov 6 | *.dylib 7 | *~ 8 | libraft.a 9 | libraft.so 10 | .env/ 11 | .hypothesis/ 12 | **/__pycache__ 13 | cmake-build* 14 | .idea 15 | tests/.raft_cffi_built 16 | tests/raft_cffi.c 17 | build/ 18 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | addons: 3 | apt: 4 | packages: 5 | - "python3" 6 | - "python3-pip" 7 | before_install: 8 | - sudo pip install cpp-coveralls 9 | - sudo pip3 install cffi 10 | - sudo pip3 install colorama 11 | - sudo pip3 install coloredlogs 12 | - sudo pip3 install docopt 13 | - sudo pip3 install terminaltables 14 | script: 15 | - make tests 16 | - make test_virtraft 17 | after_success: 18 | - coveralls --verbose --exclude include --exclude tests --exclude CLinkedListQueue 19 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/bin/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/include/raft_types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RAFT_DEFS_H_ 3 | #define RAFT_DEFS_H_ 4 | 5 | /** 6 | * Unique entry ids are mostly used for debugging and nothing else, 7 | * so there is little harm if they collide. 8 | */ 9 | typedef int raft_entry_id_t; 10 | 11 | /** 12 | * Monotonic term counter. 13 | */ 14 | typedef long int raft_term_t; 15 | 16 | /** 17 | * Monotonic log entry index. 18 | * 19 | * This is also used to as an entry count size type. 20 | */ 21 | typedef long int raft_index_t; 22 | 23 | /** 24 | * Id used to group entries into sessions 25 | */ 26 | typedef unsigned long long raft_session_t; 27 | 28 | /** 29 | * Size type. This should be at least 64 bits. 30 | */ 31 | typedef unsigned long long raft_size_t; 32 | 33 | /** 34 | * Unique node identifier. 35 | */ 36 | typedef int raft_node_id_t; 37 | 38 | /** 39 | * Unique message identifier. 40 | */ 41 | typedef unsigned long raft_msg_id_t; 42 | 43 | /** 44 | * Time type. 45 | */ 46 | typedef long long raft_time_t; 47 | 48 | #endif /* RAFT_DEFS_H_ */ 49 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raft", 3 | "version": "0.2.0", 4 | "repo": "willemt/raft", 5 | "description": "C implementation of the Raft Consensus protocol, BSD licensed", 6 | "keywords": ["raft", "consensus", "protocol"], 7 | "src": [ 8 | "include/raft.h", 9 | "include/raft_log.h", 10 | "include/raft_private.h", 11 | "src/raft_log.c", 12 | "src/raft_node.c", 13 | "src/raft_server.c", 14 | "src/raft_server_properties.c" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/scripts/amalgamate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create amalgamated source file, prints to stdout 4 | 5 | echo '/* 6 | 7 | This source file is the amalgamated version of the original. 8 | Please see github.com/willemt/raft for the original version. 9 | ' 10 | git log | head -n1 | sed 's/commit/HEAD commit:/g' 11 | echo ' 12 | ' 13 | cat LICENSE 14 | echo ' 15 | */ 16 | ' 17 | 18 | echo ' 19 | #ifndef RAFT_AMALGAMATION_SH 20 | #define RAFT_AMALGAMATION_SH 21 | ' 22 | 23 | cat include/raft.h 24 | cat include/raft_*.h 25 | cat src/raft*.c | sed 's/#include "raft.*.h"//g' | sed 's/__/__raft__/g' 26 | 27 | echo '#endif /* RAFT_AMALGAMATIONE_SH */' 28 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/tests/linked_list_queue.h: -------------------------------------------------------------------------------- 1 | #ifndef LINKED_LIST_QUEUE_H 2 | #define LINKED_LIST_QUEUE_H 3 | 4 | typedef struct llqnode_s llqnode_t; 5 | 6 | struct llqnode_s 7 | { 8 | llqnode_t *next; 9 | void *item; 10 | }; 11 | 12 | typedef struct 13 | { 14 | llqnode_t *head, *tail; 15 | int count; 16 | } linked_list_queue_t; 17 | 18 | void *llqueue_new( 19 | ); 20 | 21 | void llqueue_free( 22 | linked_list_queue_t * qu 23 | ); 24 | 25 | void *llqueue_poll( 26 | linked_list_queue_t * qu 27 | ); 28 | 29 | void llqueue_offer( 30 | linked_list_queue_t * qu, 31 | void *item 32 | ); 33 | 34 | /** 35 | * remove this item, by comparing the memory address of the item */ 36 | void *llqueue_remove_item( 37 | linked_list_queue_t * qu, 38 | const void *item 39 | ); 40 | 41 | int llqueue_count( 42 | const linked_list_queue_t * qu 43 | ); 44 | 45 | /** 46 | * remove this item, by using the supplied compare function */ 47 | void *llqueue_remove_item_via_cmpfunction( 48 | linked_list_queue_t * qu, 49 | const void *item, 50 | int (*cmp)(const void*, const void*)); 51 | 52 | /** 53 | * get this item, by using the supplied compare function */ 54 | void *llqueue_get_item_via_cmpfunction( 55 | linked_list_queue_t * qu, 56 | const void *item, 57 | long (*cmp)(const void*, const void*)); 58 | 59 | #endif /* LINKED_LIST_QUEUE_H */ 60 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | cffi==1.15.0 2 | colorama==0.4.3 3 | coloredlogs==14.0 4 | docopt==0.6.2 5 | hypothesis==5.6.0 6 | terminaltables==3.1.0 7 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/RedisRaft/tests/test_node.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "CuTest.h" 8 | 9 | #include "raft.h" 10 | #include "raft_log.h" 11 | #include "raft_private.h" 12 | 13 | void TestRaft_node_set_nextIdx(CuTest * tc) 14 | { 15 | raft_node_t *p = raft_node_new((void *) 1, 1, 1); 16 | raft_node_set_next_idx(p, 3); 17 | CuAssertTrue(tc, 3 == raft_node_get_next_idx(p)); 18 | } 19 | 20 | 21 | int main(void) 22 | { 23 | CuString *output = CuStringNew(); 24 | CuSuite* suite = CuSuiteNew(); 25 | 26 | SUITE_ADD_TEST(suite, TestRaft_node_set_nextIdx); 27 | 28 | CuSuiteRun(suite); 29 | CuSuiteDetails(suite, output); 30 | printf("%s\n", output->buffer); 31 | 32 | return suite->failCount == 0 ? 0 : 1; 33 | } 34 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.gcno 3 | *~ 4 | libcraft.so 5 | libcraft.a 6 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | addons: 3 | apt: 4 | packages: 5 | - "python3" 6 | - "python3-pip" 7 | before_install: 8 | - sudo pip install cpp-coveralls 9 | - sudo pip3 install cffi 10 | - sudo pip3 install colorama 11 | - sudo pip3 install coloredlogs 12 | - sudo pip3 install docopt 13 | - sudo pip3 install terminaltables 14 | script: 15 | - make tests 16 | - make test_virtraft 17 | after_success: 18 | - coveralls --verbose --exclude include --exclude tests --exclude CLinkedListQueue 19 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Library build : 2 | # mkdir build && cd build && cmake .. 3 | # make 4 | 5 | cmake_minimum_required(VERSION 3.7.2) 6 | 7 | project(WRaft C) 8 | 9 | # ----------------------- Build Settings Start ------------------------------- # 10 | set(CMAKE_C_STANDARD 99) 11 | set(CMAKE_C_STANDARD_REQUIRED ON) 12 | set(CMAKE_C_EXTENSIONS OFF) 13 | # ------------------------ Build Settings End -------------------------------- # 14 | 15 | # ----------------------------- C Tests Start -------------------------------- # 16 | 17 | set(RAFT_SOURCE_FILES 18 | src/raft_log.c 19 | src/raft_server.c 20 | src/raft_node.c 21 | src/raft_server_properties.c) 22 | 23 | add_library(WRaft STATIC ${RAFT_SOURCE_FILES}) 24 | target_compile_options(WRaft PRIVATE -g -Wall -Wextra) 25 | target_include_directories(WRaft PRIVATE include) 26 | 27 | add_library(WRaft_shared SHARED ${RAFT_SOURCE_FILES}) 28 | target_include_directories(WRaft_shared PRIVATE include) 29 | set_property(TARGET WRaft_shared PROPERTY POSITION_INDEPENDENT_CODE ON) 30 | target_compile_options(WRaft_shared PRIVATE -g -Wall -Wextra) 31 | # ------------------------------ C Tests End --------------------------------- # 32 | 33 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/include/raft_types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RAFT_DEFS_H_ 3 | #define RAFT_DEFS_H_ 4 | 5 | /** 6 | * Unique entry ids are mostly used for debugging and nothing else, 7 | * so there is little harm if they collide. 8 | */ 9 | typedef int raft_entry_id_t; 10 | 11 | /** 12 | * Monotonic term counter. 13 | */ 14 | typedef long int raft_term_t; 15 | 16 | /** 17 | * Monotonic log entry index. 18 | * 19 | * This is also used to as an entry count size type. 20 | */ 21 | typedef long int raft_index_t; 22 | 23 | /** 24 | * Unique node identifier. 25 | */ 26 | typedef int raft_node_id_t; 27 | 28 | #endif /* RAFT_DEFS_H_ */ 29 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raft", 3 | "version": "0.2.0", 4 | "repo": "willemt/raft", 5 | "description": "C implementation of the Raft Consensus protocol, BSD licensed", 6 | "keywords": ["raft", "consensus", "protocol"], 7 | "src": [ 8 | "include/raft.h", 9 | "include/raft_log.h", 10 | "include/raft_private.h", 11 | "src/raft_log.c", 12 | "src/raft_node.c", 13 | "src/raft_server.c", 14 | "src/raft_server_properties.c" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/scripts/amalgamate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create amalgamated source file, prints to stdout 4 | 5 | echo '/* 6 | 7 | This source file is the amalgamated version of the original. 8 | Please see github.com/willemt/raft for the original version. 9 | ' 10 | git log | head -n1 | sed 's/commit/HEAD commit:/g' 11 | echo ' 12 | ' 13 | cat LICENSE 14 | echo ' 15 | */ 16 | ' 17 | 18 | echo ' 19 | #ifndef RAFT_AMALGAMATION_SH 20 | #define RAFT_AMALGAMATION_SH 21 | ' 22 | 23 | cat include/raft.h 24 | cat include/raft_*.h 25 | cat src/raft*.c | sed 's/#include "raft.*.h"//g' | sed 's/__/__raft__/g' 26 | 27 | echo '#endif /* RAFT_AMALGAMATIONE_SH */' 28 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/tests/make-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Auto generate single AllTests file for CuTest. 4 | # Searches through all *.c files in the current directory. 5 | # Prints to stdout. 6 | # Author: Asim Jalis 7 | # Date: 01/08/2003 8 | 9 | FILES=*.c 10 | 11 | #if test $# -eq 0 ; then FILES=*.c ; else FILES=$* ; fi 12 | 13 | echo ' 14 | 15 | /* This is auto-generated code. Edit at your own peril. */ 16 | #include 17 | #include "CuTest.h" 18 | 19 | ' 20 | 21 | cat $FILES | grep '^void Test' | 22 | sed -e 's/(.*$//' \ 23 | -e 's/$/(CuTest*);/' \ 24 | -e 's/^/extern /' 25 | 26 | echo \ 27 | ' 28 | 29 | int RunAllTests(void) 30 | { 31 | CuString *output = CuStringNew(); 32 | CuSuite* suite = CuSuiteNew(); 33 | 34 | ' 35 | cat $FILES | grep '^void Test' | 36 | sed -e 's/^void //' \ 37 | -e 's/(.*$//' \ 38 | -e 's/^/ SUITE_ADD_TEST(suite, /' \ 39 | -e 's/$/);/' 40 | 41 | echo \ 42 | ' 43 | CuSuiteRun(suite); 44 | CuSuiteDetails(suite, output); 45 | printf("%s\\n", output->buffer); 46 | return suite->failCount == 0 ? 0 : 1; 47 | } 48 | 49 | int main() 50 | { 51 | return RunAllTests(); 52 | } 53 | ' 54 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/tests/raft_cffi.py: -------------------------------------------------------------------------------- 1 | import cffi 2 | import subprocess 3 | 4 | ffi = cffi.FFI() 5 | ffi.set_source( 6 | "tests", 7 | """ 8 | """, 9 | sources=""" 10 | src/raft_log.c 11 | src/raft_server.c 12 | src/raft_server_properties.c 13 | src/raft_node.c 14 | """.split(), 15 | include_dirs=["include"], 16 | ) 17 | library = ffi.compile() 18 | 19 | ffi = cffi.FFI() 20 | lib = ffi.dlopen(library) 21 | 22 | 23 | def load(fname): 24 | return '\n'.join( 25 | [line for line in subprocess.check_output( 26 | ["gcc", "-E", fname]).decode('utf-8').split('\n')]) 27 | 28 | 29 | ffi.cdef('void *malloc(size_t __size);') 30 | ffi.cdef(load('include/raft.h')) 31 | ffi.cdef(load('include/raft_log.h')) 32 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/tests/test_node.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "CuTest.h" 8 | 9 | #include "raft.h" 10 | #include "raft_log.h" 11 | #include "raft_private.h" 12 | 13 | void TestRaft_is_voting_by_default(CuTest * tc) 14 | { 15 | raft_node_t *p = raft_node_new((void*)1, 1); 16 | CuAssertTrue(tc, raft_node_is_voting(p)); 17 | } 18 | 19 | void TestRaft_node_set_nextIdx(CuTest * tc) 20 | { 21 | raft_node_t *p = raft_node_new((void*)1, 1); 22 | raft_node_set_next_idx(p, 3); 23 | CuAssertTrue(tc, 3 == raft_node_get_next_idx(p)); 24 | } 25 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/deps/WRaft/tests/test_server.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/WRaft-series/driver/deps/WRaft/tests/test_server.c -------------------------------------------------------------------------------- /systems/WRaft-series/driver/main.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "Repl.h" 3 | #include "TcpNetwork.h" 4 | 5 | DECLARE_bool(help); 6 | DEFINE_bool(verbose, false, "Show TMET information"); 7 | DEFINE_bool(detail, false, "Show Raft information"); 8 | DEFINE_string(config, "", "Config file"); 9 | DEFINE_string(name, "", "Self name"); 10 | 11 | void setup(int argc, char **argv) { 12 | // Parse arguments and show help 13 | SetUsageMessage("Redis TMET node program"); 14 | ParseCommandLineNonHelpFlags(&argc, &argv, true); 15 | if (FLAGS_help || argc != 1) { 16 | ShowUsageWithFlagsRestrict(argv[0], "main"); 17 | exit(1); 18 | } else if (FLAGS_detail) { 19 | FLAGS_verbose = true; 20 | } 21 | 22 | init_prompt_color(); 23 | } 24 | 25 | int main(int argc, char **argv) { 26 | setup(argc, argv); 27 | if (!FLAGS_config.empty()) { 28 | config.load(FLAGS_config); 29 | } 30 | net = new TcpNetwork(); 31 | Repl repl; 32 | repl.readline(); 33 | } 34 | -------------------------------------------------------------------------------- /systems/WRaft-series/driver/tlpi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(tlpi) 3 | 4 | set(CMAKE_C_STANDARD 99) 5 | add_compile_options(-Wall -Wextra -Werror) 6 | 7 | add_library(tlpi inet_sockets.c inet_sockets.h tlpi_hdr.h) 8 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: XRaft.tla 3 | model name: mc/mc 4 | workers: auto 5 | check deadlock: false 6 | memory ratio: 0.3 7 | 8 | [behavior] 9 | temporal formula: Spec 10 | 11 | [invariants] 12 | ; TypeOk: TypeOk 13 | INV: INV 14 | ElectionSafety: ElectionSafety 15 | LogMatching: LogMatching 16 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 17 | NextIdxGtMatchIdx: NextIdxGtMatchIdx 18 | NextIdxGtZero: NextIdxGtZero 19 | CommitIdxLELogLen: CommitIdxLELogLen 20 | LeaderTermLogHasGreatestIdx: LeaderTermLogHasGreatestIdx 21 | 22 | [state constraint] 23 | SC: SC 24 | 25 | [constants] 26 | M_AER: [model value] 27 | M_AE: [model value] 28 | M_RVR: [model value] 29 | M_RV: [model value] 30 | Leader: [model value] 31 | Follower: [model value] 32 | PreCandidate: [model value] 33 | Candidate: [model value] 34 | NoOp: [model value] 35 | Nil: [model value] 36 | Commands: [model value]{v1, v2} 37 | Servers: [model value]{n1, n2, n3} 38 | Parameters: [MaxElectionTimes |-> 3, 39 | MaxAppendEntriesTimes |-> 3, 40 | MaxPartitionTimes |-> 1, 41 | MaxClientOperationsTimes |-> 3, 42 | MaxWireMsgs |-> 6] 43 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/bin/xraft-kvstore: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_DIR=$(dirname $0) 4 | BASE_DIR=$(dirname ${SCRIPT_DIR}) 5 | LIB_DIR=${BASE_DIR}/lib 6 | 7 | JAVA_EXECUTABLE=java 8 | 9 | CLASS_PATH= 10 | for file in `ls ${LIB_DIR}`; do 11 | CLASS_PATH=${LIB_DIR}/${file}:${CLASS_PATH} 12 | done 13 | 14 | ${JAVA_EXECUTABLE} -cp ${CLASS_PATH} \ 15 | -Dlog4j.configurationFile=${BASE_DIR}/conf/log4j2.xml \ 16 | in.xnnyygn.xraft.kvstore.server.ServerLauncher "$@" -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/bin/xraft-kvstore-cli: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_DIR=$(dirname $0) 4 | BASE_DIR=$(dirname ${SCRIPT_DIR}) 5 | LIB_DIR=${BASE_DIR}/lib 6 | 7 | JAVA_EXECUTABLE=java 8 | 9 | CLASS_PATH= 10 | for file in `ls ${LIB_DIR}`; do 11 | CLASS_PATH=${LIB_DIR}/${file}:${CLASS_PATH} 12 | done 13 | 14 | ${JAVA_EXECUTABLE} -cp ${CLASS_PATH} \ 15 | -Dlog4j.configurationFile=${BASE_DIR}/conf/log4j2.xml \ 16 | in.xnnyygn.xraft.kvstore.client.ConsoleLauncher "$@" -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cli.sh n1 get 4 | # cli.sh n2 put 2 5 | 6 | set -e 7 | SCRIPT_DIR=$(dirname "$(realpath "$0")") 8 | 9 | node=${1/n/} 10 | cmd=$2 11 | cmd_value=$3 12 | ip=$(dig +short n${node}) 13 | $SCRIPT_DIR/bin/xraft-kvstore-cli -${cmd} $cmd_value -gc ${1},${ip},3333 | grep -v DEBUG 14 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/conf/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/conf/xraft-kvstore.properties: -------------------------------------------------------------------------------- 1 | # xraft core settings 2 | # all time in milliseconds 3 | 4 | # election timeout 5 | xraft.core.election.timeout.min=3000 6 | xraft.core.election.timeout.max=4000 7 | 8 | # replication 9 | xraft.core.replication.delay=0 10 | xraft.core.replication.interval=1000 11 | xraft.core.replication.timeout.read=900 12 | xraft.core.replication.entries.max=-1 13 | 14 | # in byte 15 | xraft.core.snapshot.data.length=1024 16 | 17 | # new node 18 | xraft.core.new-node.replication.entries.max=-1 19 | xraft.core.new-node.round.max=10 20 | xraft.core.new-node.timeout.read=3000 21 | xraft.core.new-node.timeout.advance=3000 22 | 23 | xraft-core.group.config.change.timeout=0 -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/data/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/data/.keep -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/commons-cli-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/commons-cli-1.4.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/guava-29.0-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/guava-29.0-jre.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/jline-3.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/jline-3.9.0.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-buffer-4.1.46.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-buffer-4.1.46.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-codec-4.1.46.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-codec-4.1.46.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-common-4.1.46.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-common-4.1.46.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-handler-4.1.46.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-handler-4.1.46.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-resolver-4.1.46.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-resolver-4.1.46.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-transport-4.1.46.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/netty-transport-4.1.46.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/protobuf-java-3.16.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/protobuf-java-3.16.3.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/xraft-core-0.1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/xraft-core-0.1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/lib/xraft-kvstore-0.1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/lib/xraft-kvstore-0.1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/election_safety/kv-store/log/.keep -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/election_safety/kv-store/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -xe 4 | 5 | CONFIG_FILE=${CONFIG_FILE:-$1} 6 | test $SSH_NO 7 | test $CONFIG_FILE 8 | 9 | SCRIPT_DIR=$(dirname "$(realpath "$0")") 10 | 11 | nodes=($(dig +short n{1,2,3} | sed "$(sed -En -e 's,.0/24,,g' -e 's/map-cidr (.*) (.*)/s,\2,\1,g/p' $CONFIG_FILE)")) 12 | 13 | #export LD_DEBUG=all 14 | 15 | java -cp "$SCRIPT_DIR/lib/*" -Dlog4j.configurationFile="$SCRIPT_DIR/conf/log4j2.xml" in.xnnyygn.xraft.kvstore.server.ServerLauncher \ 16 | -gc n1,${nodes[0]},2333 n2,${nodes[1]},2333 n3,${nodes[2]},2333 -m group-member -i n$SSH_NO -p2 3333 17 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/MC.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: XRaftKVS.tla 3 | model name: mc/mc 4 | workers: auto 5 | workers: SHOW_IN_TABLE 6 | check deadlock: false 7 | memory ratio: 0.3 8 | memory ratio: SHOW_IN_TABLE 9 | 10 | [behavior] 11 | temporal formula: Spec 12 | 13 | [invariants] 14 | INV: INV 15 | ElectionSafety: ElectionSafety 16 | LogMatching: LogMatching 17 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 18 | NextIdxGtMatchIdx: NextIdxGtMatchIdx 19 | NextIdxGtZero: NextIdxGtZero 20 | CommitIdxLELogLen: CommitIdxLELogLen 21 | LeaderTermLogHasGreatestIdx: LeaderTermLogHasGreatestIdx 22 | Linearizability: Linearizability 23 | 24 | [state constraint] 25 | SC: SC 26 | 27 | [constants] 28 | M_AER: [model value] 29 | M_AE: [model value] 30 | M_RVR: [model value] 31 | M_RV: [model value] 32 | Leader: [model value] 33 | Follower: [model value] 34 | PreCandidate: [model value] 35 | Candidate: [model value] 36 | NoOp: [model value] 37 | Nil: [model value] 38 | Commands: [model value]{v1, v2} 39 | Servers: [model value]{n1, n2, n3} 40 | Parameters: [MaxElectionTimes |-> 3, 41 | MaxAppendEntriesTimes |-> 3, 42 | MaxPartitionTimes |-> 1, 43 | MaxClientOperationsTimes |-> 3, 44 | MaxWireMsgs |-> 6, 45 | MaxClientGetTimes |-> 3 ] 46 | Parameters: SHOW_IN_TABLE 47 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/bin/xraft-kvstore: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_DIR=$(dirname $0) 4 | BASE_DIR=$(dirname ${SCRIPT_DIR}) 5 | LIB_DIR=${BASE_DIR}/lib 6 | 7 | JAVA_EXECUTABLE=java 8 | 9 | CLASS_PATH= 10 | for file in `ls ${LIB_DIR}`; do 11 | CLASS_PATH=${LIB_DIR}/${file}:${CLASS_PATH} 12 | done 13 | 14 | ${JAVA_EXECUTABLE} -cp ${CLASS_PATH} \ 15 | -Dlog4j.configurationFile=${BASE_DIR}/conf/log4j2.xml \ 16 | in.xnnyygn.xraft.kvstore.server.ServerLauncher "$@" -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/bin/xraft-kvstore-cli: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_DIR=$(dirname $0) 4 | BASE_DIR=$(dirname ${SCRIPT_DIR}) 5 | LIB_DIR=${BASE_DIR}/lib 6 | 7 | JAVA_EXECUTABLE=java 8 | 9 | CLASS_PATH= 10 | for file in `ls ${LIB_DIR}`; do 11 | CLASS_PATH=${LIB_DIR}/${file}:${CLASS_PATH} 12 | done 13 | 14 | ${JAVA_EXECUTABLE} -cp ${CLASS_PATH} \ 15 | -Dlog4j.configurationFile=${BASE_DIR}/conf/log4j2.xml \ 16 | in.xnnyygn.xraft.kvstore.client.ConsoleLauncher "$@" -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cli.sh n1 get 4 | # cli.sh n2 put 2 5 | 6 | set -e 7 | SCRIPT_DIR=$(dirname "$(realpath "$0")") 8 | 9 | node=${1/n/} 10 | cmd=$2 11 | cmd_value=$3 12 | ip=$(dig +short n${node}) 13 | $SCRIPT_DIR/bin/xraft-kvstore-cli -${cmd} $cmd_value -gc ${1},${ip},3333 | grep -v DEBUG 14 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/conf/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/conf/xraft-kvstore.properties: -------------------------------------------------------------------------------- 1 | # xraft core settings 2 | # all time in milliseconds 3 | 4 | # election timeout 5 | xraft.core.election.timeout.min=3000 6 | xraft.core.election.timeout.max=4000 7 | 8 | # replication 9 | xraft.core.replication.delay=0 10 | xraft.core.replication.interval=1000 11 | xraft.core.replication.timeout.read=900 12 | xraft.core.replication.entries.max=-1 13 | 14 | # in byte 15 | xraft.core.snapshot.data.length=1024 16 | 17 | # new node 18 | xraft.core.new-node.replication.entries.max=-1 19 | xraft.core.new-node.round.max=10 20 | xraft.core.new-node.timeout.read=3000 21 | xraft.core.new-node.timeout.advance=3000 22 | 23 | xraft-core.group.config.change.timeout=0 -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/data/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/data/.keep -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/commons-cli-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/commons-cli-1.4.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/guava-32.0.0-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/guava-32.0.0-jre.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/jline-3.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/jline-3.9.0.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-buffer-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-buffer-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-codec-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-codec-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-common-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-common-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-handler-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-handler-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-resolver-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-resolver-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-transport-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-transport-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-transport-native-unix-common-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/netty-transport-native-unix-common-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/protobuf-java-3.16.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/protobuf-java-3.16.3.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/xraft-core-0.1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/xraft-core-0.1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/lib/xraft-kvstore-0.1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/lib/xraft-kvstore-0.1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/Xraft-series/bugs/linearizability/kv-store/log/.keep -------------------------------------------------------------------------------- /systems/Xraft-series/bugs/linearizability/kv-store/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -xe 4 | 5 | CONFIG_FILE=${CONFIG_FILE:-$1} 6 | test $SSH_NO 7 | test $CONFIG_FILE 8 | 9 | SCRIPT_DIR=$(dirname "$(realpath "$0")") 10 | 11 | nodes=($(dig +short n{1,2,3} | sed "$(sed -En -e 's,.0/24,,g' -e 's/map-cidr (.*) (.*)/s,\2,\1,g/p' $CONFIG_FILE)")) 12 | 13 | #export LD_DEBUG=all 14 | 15 | java -cp "$SCRIPT_DIR/lib/*" -Dlog4j.configurationFile="$SCRIPT_DIR/conf/log4j2.xml" in.xnnyygn.xraft.kvstore.server.ServerLauncher \ 16 | -gc n1,${nodes[0]},2333 n2,${nodes[1]},2333 n3,${nodes[2]},2333 -m group-member -i n$SSH_NO -p2 3333 17 | -------------------------------------------------------------------------------- /systems/Xraft-series/scripts/branch_counter.py: -------------------------------------------------------------------------------- 1 | counter = { 2 | "Init": 0, 3 | "ElectionTimeout": 0, 4 | "RecvRequestVote": { 5 | "not-vote: term bigger": 0, 6 | "not-vote: step down log newer": 0, 7 | "not-vote: voted for self": 0, 8 | "not-vote: voted or log newer": 0, 9 | "voted": 0, 10 | }, 11 | "RecvRequestVoteResponse": { 12 | "term is smaller": 0, 13 | "not candidate or term mismatch": 0, 14 | "become leader": 0, 15 | "granted": 0, 16 | "not granted": 0, 17 | }, 18 | "SendAppendentriesAll": 0, 19 | "RecvAppendentries": { 20 | "term is bigger": 0, 21 | "no prev log": 0, 22 | "term mismatch": 0, 23 | "success": 0, 24 | }, 25 | "RecvAppendentriesResponse": { 26 | "stale msg": 0, 27 | "term is smaller": 0, 28 | "not leader": 0, 29 | "fail retry": 0, 30 | "success": 0, 31 | "success retry": 0, 32 | }, 33 | "RecvEntry": 0, 34 | "ClientGetValue": 0, 35 | "DoNetworkPartition": 0, 36 | "DoNetworkCure": 0, 37 | } 38 | 39 | jq_cmd_str = '.[] | .netcmd | .[0] | .[0:2]' 40 | jq_inv_str = '.[] | .inv | .[]' 41 | -------------------------------------------------------------------------------- /systems/Xraft-series/scripts/env.sh: -------------------------------------------------------------------------------- 1 | source $(dirname "$(realpath "$0")")/../../../scripts/env.sh && export CUR_SCRIPT_DIR=$(eval $(get_dir_cmd)) && export_more -------------------------------------------------------------------------------- /systems/Xraft-series/scripts/mc.ini: -------------------------------------------------------------------------------- 1 | [options] 2 | target: ../specs/XRaftKVS.tla 3 | model name: mc/mc 4 | workers: 8 5 | workers: SHOW_IN_TABLE 6 | check deadlock: false 7 | memory ratio: 0.3 8 | memory ratio: SHOW_IN_TABLE 9 | 10 | [behavior] 11 | temporal formula: Spec 12 | 13 | [invariants] 14 | INV: INV 15 | ElectionSafety: ElectionSafety 16 | LogMatching: LogMatching 17 | CommittedLogReplicatedMajority: CommittedLogReplicatedMajority 18 | NextIdxGtMatchIdx: NextIdxGtMatchIdx 19 | NextIdxGtZero: NextIdxGtZero 20 | CommitIdxLELogLen: CommitIdxLELogLen 21 | LeaderTermLogHasGreatestIdx: LeaderTermLogHasGreatestIdx 22 | Linearizability: Linearizability 23 | 24 | [state constraint] 25 | SC: SC 26 | 27 | [constants] 28 | M_AER: [model value] 29 | M_AE: [model value] 30 | M_RVR: [model value] 31 | M_RV: [model value] 32 | Leader: [model value] 33 | Follower: [model value] 34 | PreCandidate: [model value] 35 | Candidate: [model value] 36 | NoOp: [model value] 37 | Nil: [model value] 38 | Commands: [model value]{v1, v2} 39 | Servers: [model value]{n1, n2, n3} 40 | Parameters: [MaxElectionTimes |-> 2, 41 | MaxAppendEntriesTimes |-> 2, 42 | MaxPartitionTimes |-> 1, 43 | MaxClientOperationsTimes |-> 2, 44 | MaxClientGetTimes |-> 2, 45 | MaxWireMsgs |-> 4] 46 | Parameters: SHOW_IN_TABLE 47 | -------------------------------------------------------------------------------- /systems/Xraft-series/scripts/run_one_testcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source ${RUN_ONE_TESTCASE_COMMON_SH} "$@" -p "$(dirname $1)" 5 | -------------------------------------------------------------------------------- /systems/Xraft-series/scripts/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source $START_DOCKER_COMMON_SH "$@" 5 | 6 | CLIENT=$(pwd)/../kv-store/start.sh 7 | 8 | HOST_CMD="-r 'sudo timeout --foreground $TIMEOUT $CONTROLLER -detail -config $CONFIG_FILE -tmpdir $TMPDIR -half_duplex_connection; exit'" 9 | 10 | cat <> "$GEN_FILE" 8 | log stdout node_log 9 | log stderr node_log 10 | collector /usr/bin/python3 $state_collector_py 11 | option state_no_fail_empty 12 | EOF 13 | -------------------------------------------------------------------------------- /systems/ZooKeeper/Makefile: -------------------------------------------------------------------------------- 1 | check_zookeeper_vote_circle_bug: 2 | docker exec controller rm -rf '/root/sandtable/systems/ZooKeeper/v3.4.3/bugs/vote_circle/mc' 3 | docker exec -it controller sh -c "cd /root/sandtable/systems/ZooKeeper/v3.4.3/bugs/vote_circle && python3 /root/sandtable/scripts/tlcwrapper.py -s MC.ini" 4 | docker exec controller sh -c "cd /root/sandtable/systems/ZooKeeper/v3.4.3/bugs/vote_circle/mc && find -name MC.out | xargs ls -t | head -1 | xargs python3 /root/sandtable/scripts/trace_reader.py | jq -c '.[].netcmd[0]'" 5 | 6 | replay_zookeeper_vote_circle_bug: 7 | docker exec controller rm -rf /root/sandtable/systems/ZooKeeper/v3.4.3/bugs/vote_circle/test 8 | docker exec -it controller /root/sandtable/systems/ZooKeeper/v3.4.3/scripts/run_one_testcase.sh /root/sandtable/systems/ZooKeeper/v3.4.3/bugs/vote_circle/MC.out 9 | echo ==== Replay logs location: build/mount/systems/ZooKeeper/v3.4.3/bugs/vote_circle/test 10 | grep -E '(- Updating proposal)' build/mount/systems/ZooKeeper/v3.4.3/bugs/vote_circle/test/node_log.1 11 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/scripts/env.sh: -------------------------------------------------------------------------------- 1 | source $(dirname "$(realpath "$0")")/../../../../scripts/env.sh && export CUR_SCRIPT_DIR=$(eval $(get_dir_cmd)) && export_more -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/scripts/run_one_testcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source ${RUN_ONE_TESTCASE_COMMON_SH} "$@" 5 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/scripts/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source $START_DOCKER_COMMON_SH "$@" 5 | 6 | CLIENT=$CUR_SCRIPT_DIR/../zookeeper-3.4.3/start.sh 7 | 8 | HOST_CMD="-r 'sudo timeout --foreground $TIMEOUT $CONTROLLER -detail -config $CONFIG_FILE -tmpdir $TMPDIR; exit'" 9 | 10 | cat <> "$GEN_FILE" 7 | log stdout node_log 8 | log stderr node_log 9 | collector /usr/bin/python3 $state_collector_py 10 | option detail 11 | option tmpdir 12 | option multi_ports 13 | option block_connect_timeout 3 14 | option deliver_first_msg_ports 3888 15 | option merge_small_msg 4 16 | option no_exec_ack 17 | option add_ssh_timeout 10 18 | option abort_failed_init 19 | #option state_no_clear 20 | #option state_no_fail_empty 21 | EOF 22 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/bin/README.txt: -------------------------------------------------------------------------------- 1 | This directory contain scripts that allow easy access (classpath in particular) 2 | to the ZooKeeper server and command line client. 3 | 4 | Files ending in .sh are unix and cygwin compatible 5 | 6 | Files ending in .cmd are msdos/windows compatible 7 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/bin/zkCli.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.ZooKeeperMain 21 | java "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% %* 22 | 23 | endlocal 24 | 25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/bin/zkServer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.server.quorum.QuorumPeerMain 21 | echo on 22 | java "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %* 23 | 24 | endlocal 25 | 26 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/conf/configuration.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
namevaluedescription
21 | 22 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/conf/zoo_sample.cfg: -------------------------------------------------------------------------------- 1 | # The number of milliseconds of each tick 2 | tickTime=2000 3 | # The number of ticks that the initial 4 | # synchronization phase can take 5 | initLimit=10 6 | # The number of ticks that can pass between 7 | # sending a request and getting an acknowledgement 8 | syncLimit=5 9 | # the directory where the snapshot is stored. 10 | # do not use /tmp for storage, /tmp here is just 11 | # example sakes. 12 | dataDir=/tmp/zookeeper 13 | # the port at which the clients will connect 14 | clientPort=2181 15 | # 16 | # Be sure to read the maintenance section of the 17 | # administrator guide before turning on autopurge. 18 | # 19 | # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance 20 | # 21 | # The number of snapshots to retain in dataDir 22 | #autopurge.snapRetainCount=3 23 | # Purge task interval in hours 24 | # Set to "0" to disable auto purge feature 25 | #autopurge.purgeInterval=1 26 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/config/defaultConnectionSettings.cfg: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | #Default connection for ZooInspector 17 | #Sun Feb 28 14:46:55 GMT 2010 18 | hosts=localhost\:2181 19 | encryptionManager=org.apache.zookeeper.inspector.encryption.BasicDataEncryptionManager 20 | timeout=5000 21 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/config/defaultNodeVeiwers.cfg: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | org.apache.zookeeper.inspector.gui.nodeviewer.NodeViewerData 16 | org.apache.zookeeper.inspector.gui.nodeviewer.NodeViewerMetaData 17 | org.apache.zookeeper.inspector.gui.nodeviewer.NodeViewerACL 18 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/edtsrclkup_co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/edtsrclkup_co.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/file_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/file_obj.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/fldr_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/fldr_obj.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/info_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/info_obj.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/jspdecl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/jspdecl.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/launch_run.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/launch_run.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/launch_stop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/launch_stop.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/new_con.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/new_con.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/refresh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/refresh.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/save_edit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/save_edit.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/search_next.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/search_next.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/search_prev.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/search_prev.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/trash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/icons/trash.gif -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/lib/jtoaster-1.0.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/lib/jtoaster-1.0.4.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/zookeeper-3.4.3-ZooInspector.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/ZooInspector/zookeeper-3.4.3-ZooInspector.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/fatjar/conf/mainClasses: -------------------------------------------------------------------------------- 1 | ::Client Commands 2 | client:org.apache.zookeeper.ZooKeeperMain:Client shell to ZooKeeper 3 | ::Server Commands 4 | server:org.apache.zookeeper.server.quorum.QuorumPeerMain:Start ZooKeeper server 5 | ::Test Commands 6 | generateLoad:org.apache.zookeeper.test.system.GenerateLoad:A distributed load generator for testing 7 | quorumBench:org.apache.zookeeper.server.QuorumBenchmark:A benchmark of just the quorum protocol 8 | abBench:org.apache.zookeeper.server.quorum.AtomicBroadcastBenchmark:A benchmark of just the atomic broadcast 9 | ic:org.apache.zookeeper.test.system.InstanceContainer:A container that will instantiate classes as directed by an instance manager 10 | systest:org.apache.zookeeper.test.system.BaseSysTest:Start system test 11 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/fatjar/zookeeper-3.4.3-fatjar.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/fatjar/zookeeper-3.4.3-fatjar.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/loggraph/zookeeper-3.4.3-loggraph.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/loggraph/zookeeper-3.4.3-loggraph.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/rest/zookeeper-3.4.3-rest.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/rest/zookeeper-3.4.3-rest.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zkfuse/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS = src 4 | 5 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zkfuse/VERSION: -------------------------------------------------------------------------------- 1 | 3.4.3 2 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zkperl/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | LICENSE 3 | Makefile.PL 4 | MANIFEST 5 | NOTICE 6 | README 7 | typemap 8 | ZooKeeper.pm 9 | ZooKeeper.xs 10 | build/check_zk_version.c 11 | build/check_zk_version.h 12 | t/10_invalid.t 13 | t/15_thread.t 14 | t/20_tie.t 15 | t/22_stat_tie.t 16 | t/24_watch_tie.t 17 | t/30_connect.t 18 | t/35_log.t 19 | t/40_basic.t 20 | t/45_class.t 21 | t/50_access.t 22 | t/60_watch.t 23 | t/util.pl 24 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zkperl/NOTICE: -------------------------------------------------------------------------------- 1 | Net::ZooKeeper - Perl extension for Apache ZooKeeper 2 | Copyright 2009 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zkperl/VERSION: -------------------------------------------------------------------------------- 1 | 3.4.3 2 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zkpython/VERSION: -------------------------------------------------------------------------------- 1 | 3.4.3 2 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zktreeutil/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS = src 4 | 5 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/contrib/zktreeutil/VERSION: -------------------------------------------------------------------------------- 1 | 3.4.3 2 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3-javadoc.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3-sources.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3-tests.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3-tests.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/dist-maven/zookeeper-3.4.3.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/cobertura/README.txt: -------------------------------------------------------------------------------- 1 | Download the cobertura binary from the following location and unpack it into this directory. Run "cobertura-report" target from build.xml to generate coverage report. 2 | 3 | http://cobertura.sourceforge.net/download.html 4 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/jline-0.9.94.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/jline-0.9.94.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/log4j-1.2.15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/log4j-1.2.15.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/netty-3.2.2.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/netty-3.2.2.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/slf4j-api-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/slf4j-api-1.6.1.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/slf4j-log4j12-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/lib/slf4j-log4j12-1.6.1.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/zookeeper-3.4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.4.3/zookeeper-3.4.3/zookeeper-3.4.3.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/README.txt: -------------------------------------------------------------------------------- 1 | This directory contain scripts that allow easy access (classpath in particular) 2 | to the ZooKeeper server and command line client. 3 | 4 | Files ending in .sh are unix and cygwin compatible 5 | 6 | Files ending in .cmd are msdos/windows compatible 7 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/zkCli.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOO_LOG_FILE=zookeeper-%USERNAME%-cli-%COMPUTERNAME%.log 21 | 22 | set ZOOMAIN=org.apache.zookeeper.ZooKeeperMain 23 | call %JAVA% "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.log.file=%ZOO_LOG_FILE%" -cp "%CLASSPATH%" %ZOOMAIN% %* 24 | 25 | endlocal 26 | 27 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/zkServer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.server.quorum.QuorumPeerMain 21 | set ZOO_LOG_FILE=zookeeper-%USERNAME%-server-%COMPUTERNAME%.log 22 | 23 | echo on 24 | call %JAVA% "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.log.file=%ZOO_LOG_FILE%" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%%%p /t /f" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %* 25 | 26 | endlocal 27 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/zkSnapShotToolkit.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.server.SnapshotFormatter 21 | call %JAVA% -cp "%CLASSPATH%" %ZOOMAIN% %* 22 | 23 | endlocal 24 | 25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/zkSnapshotComparer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.server.SnapshotComparer 21 | call %JAVA% -cp "%CLASSPATH%" %ZOOMAIN% %* 22 | 23 | endlocal 24 | 25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/zkSnapshotRecursiveSummaryToolkit.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.server.SnapshotRecursiveSummary 21 | call %JAVA% -cp "%CLASSPATH%" %ZOOMAIN% %* 22 | 23 | endlocal 24 | 25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/bin/zkTxnLogToolkit.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Licensed to the Apache Software Foundation (ASF) under one or more 3 | REM contributor license agreements. See the NOTICE file distributed with 4 | REM this work for additional information regarding copyright ownership. 5 | REM The ASF licenses this file to You under the Apache License, Version 2.0 6 | REM (the "License"); you may not use this file except in compliance with 7 | REM the License. You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | 17 | setlocal 18 | call "%~dp0zkEnv.cmd" 19 | 20 | set ZOOMAIN=org.apache.zookeeper.server.persistence.TxnLogToolkit 21 | call %JAVA% -cp "%CLASSPATH%" %ZOOMAIN% %* 22 | 23 | endlocal 24 | 25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/conf/configuration.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
namevaluedescription
21 | 22 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/conf/zoo_sample.cfg: -------------------------------------------------------------------------------- 1 | # The number of milliseconds of each tick 2 | tickTime=2000 3 | # The number of ticks that the initial 4 | # synchronization phase can take 5 | initLimit=10 6 | # The number of ticks that can pass between 7 | # sending a request and getting an acknowledgement 8 | syncLimit=5 9 | # the directory where the snapshot is stored. 10 | # do not use /tmp for storage, /tmp here is just 11 | # example sakes. 12 | dataDir=/tmp/zookeeper 13 | # the port at which the clients will connect 14 | clientPort=2181 15 | # the maximum number of client connections. 16 | # increase this if you need to handle more clients 17 | #maxClientCnxns=60 18 | # 19 | # Be sure to read the maintenance section of the 20 | # administrator guide before turning on autopurge. 21 | # 22 | # https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance 23 | # 24 | # The number of snapshots to retain in dataDir 25 | #autopurge.snapRetainCount=3 26 | # Purge task interval in hours 27 | # Set to "0" to disable auto purge feature 28 | #autopurge.purgeInterval=1 29 | 30 | ## Metrics Providers 31 | # 32 | # https://prometheus.io Metrics Exporter 33 | #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider 34 | #metricsProvider.httpHost=0.0.0.0 35 | #metricsProvider.httpPort=7000 36 | #metricsProvider.exportJvmInfo=true 37 | 38 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/audience-annotations-0.12.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/audience-annotations-0.12.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/commons-cli-1.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/commons-cli-1.5.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/commons-io-2.11.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/commons-io-2.11.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jackson-annotations-2.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jackson-annotations-2.15.2.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jackson-core-2.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jackson-core-2.15.2.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jackson-databind-2.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jackson-databind-2.15.2.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/javax.servlet-api-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/javax.servlet-api-3.1.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-http-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-http-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-io-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-io-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-security-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-security-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-server-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-server-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-servlet-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-servlet-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-util-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-util-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-util-ajax-9.4.51.v20230217.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jetty-util-ajax-9.4.51.v20230217.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jline-2.14.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/jline-2.14.6.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/logback-classic-1.2.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/logback-classic-1.2.10.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/logback-core-1.2.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/logback-core-1.2.10.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/metrics-core-4.1.12.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/metrics-core-4.1.12.1.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-buffer-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-buffer-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-codec-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-codec-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-common-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-common-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-handler-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-handler-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-resolver-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-resolver-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-boringssl-static-2.0.61.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-classes-2.0.61.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-tcnative-classes-2.0.61.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-classes-epoll-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-classes-epoll-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-native-unix-common-4.1.94.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/netty-transport-native-unix-common-4.1.94.Final.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient-0.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient-0.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient_common-0.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient_common-0.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient_hotspot-0.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient_hotspot-0.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient_servlet-0.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/simpleclient_servlet-0.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/slf4j-1.7.30.LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2017 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/slf4j-api-1.7.30.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/slf4j-api-1.7.30.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/snappy-java-1.1.10.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/snappy-java-1.1.10.1.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/zookeeper-3.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/zookeeper-3.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/zookeeper-jute-3.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/zookeeper-jute-3.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/zookeeper-prometheus-metrics-3.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangruize/SandTable/c62c4f588c520f80621857c43f136e370744c985/systems/ZooKeeper/v3.9.0/apache-zookeeper-3.9.0-bin/lib/zookeeper-prometheus-metrics-3.9.0.jar -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/scripts/env.sh: -------------------------------------------------------------------------------- 1 | source $(dirname "$(realpath "$0")")/../../../../scripts/env.sh && export CUR_SCRIPT_DIR=$(eval $(get_dir_cmd)) && export_more -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/scripts/run_one_testcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source ${RUN_ONE_TESTCASE_COMMON_SH} "$@" 5 | -------------------------------------------------------------------------------- /systems/ZooKeeper/v3.9.0/scripts/start_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname "$(realpath "$0")")/env.sh 4 | source $START_DOCKER_COMMON_SH "$@" 5 | 6 | CLIENT=$CUR_SCRIPT_DIR/../zookeeper-3.4.3/start.sh 7 | 8 | HOST_CMD="-r 'sudo timeout --foreground $TIMEOUT $CONTROLLER -detail -config $CONFIG_FILE -tmpdir $TMPDIR; exit'" 9 | 10 | cat <> "$GEN_FILE" 7 | log stdout node_log 8 | log stderr node_log 9 | collector /usr/bin/python3 $state_collector_py 10 | option detail 11 | option tmpdir 12 | option multi_ports 13 | option block_connect_timeout 3 14 | option deliver_first_msg_ports 3888 15 | option merge_small_msg 4 16 | option no_exec_ack 17 | option add_ssh_timeout 10 18 | option abort_failed_init 19 | #option state_no_clear 20 | #option state_no_fail_empty 21 | EOF 22 | --------------------------------------------------------------------------------