美文网首页
015 es并发控制

015 es并发控制

作者: zhu733756 | 来源:发表于2020-03-29 20:08 被阅读0次

    # 并发控制,es中没有行锁,所以用的是乐观锁机制,也就是通过version增加来控制,

    # 可以尝试用if_seq_no=0&if_primary_term=1来检测版本冲突

    DELETE blogs

    PUT /blogs/_doc/1

    {

        "title": "Quick brown rabbits",

        "body":  "Brown rabbits are commonly seen."

    }

    PUT /blogs/_doc/1?if_seq_no=2&if_primary_term=1

    {

        "title": "Quick brown rabbits",

        "body":  "Brown rabbits are commonly seen."

    }

    PUT /blogs/_doc/1

    {

        "title": "Keeping pets healthy",

        "body":  "My quick brown fox eats rabbits on a regular basis."

    }

    PUT /blogs/_doc/1?version=30000&version_type=external

    {

        "title": "Keeping pets healthy",

        "body":  "My quick brown fox eats rabbits on a regular basis."

    }

    相关文章

      网友评论

          本文标题:015 es并发控制

          本文链接:https://www.haomeiwen.com/subject/liauuhtx.html