项目作者: bchu7796

项目描述 :
An implementation of causal consistency distributed system.
高级语言: C++
项目地址: git://github.com/bchu7796/CausalConsistencyServer.git
创建时间: 2019-11-23T03:49:19Z
项目社区:https://github.com/bchu7796/CausalConsistencyServer

开源协议:MIT License

下载


Causal Consistency Distributed System

When a distributed system is composed of multiple servers/datacenters and multiple clients. It might encounter issues related to ordering. The messages travel through the Internet might arrived replicated servers in unexpected order. If these messages are causal related, the state of the servers would suffer from inconsistency.

The system implemented is aim at solving the problem metioned earlier. The servers commit replicated requests in causal ordering, this allows distributed system to stay in causal consistency.

Examples

The following image shows the problem caused by unexpected ordering.

Test Image 1

The system enforces causal ordering and prevent the issue shown in the image.

Download and Compile

  1. Clone the repository

    1. https://github.com/bchu7796/CausalConsistencyServer.git
  2. Go to the work directory

    1. cd CausalConsistencyServer/
  3. Compile

    1. make all
  4. Execute server

    1. ./server
  5. Execute client

    1. ./client

    Client Commands

  6. Read a variable

    1. read 'key'
  7. Write a variable

    1. write 'key' 'value'

Testing

  1. Unzip “test_env.zip”
    1. unzip test_env.zip
  2. Go to test_env directory
    1. cd test_env
  3. Compile
    1. make all
  4. Execute client and server in client_server1/, client_server2/, and client_server3/

  5. Emulate the example shown in “Examples” section.

    1. In client1, write lost
      1. >write x lost
    2. In client1, write found
      1. >write y found
    3. In client2, read found
      1. >read y
    4. In client2, write glad
      1. >write z glad
    5. Server3 would delay message z from client2 until it receives message x.