Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[leo_storage][read-repair] unnecessary check happen #544

Closed
mocchira opened this issue Dec 15, 2016 · 1 comment
Closed

[leo_storage][read-repair] unnecessary check happen #544

mocchira opened this issue Dec 15, 2016 · 1 comment

Comments

@mocchira
Copy link
Member

like this with N=2.
now leo_storage_read_repairer:compare called twice (one of that is check oneself) but should be only once.

(storage_0@127.0.0.1)1> recon_trace:calls({leo_storage_read_repairer, compare, fun(_) -> return_trace() end}, 10, [{scope, local}]).
1

4:42:26.519992 <0.1716.2> leo_storage_read_repairer:compare(#Ref<0.0.1.207799>, <0.1715.2>, <0.1718.2>, '[email protected]', {state,0,undefined,2,
       [{redundant_node,'[email protected]',true,true,'L'},
        {redundant_node,'[email protected]',true,true,'FL'}],
       {metadata_2,<<"test/README.md">>,
                   259282365037923196831115620348746724776,14,12487,<<>>,0,0,
                   0,0,194,1481769775994683,63648988975,
                   111724457788928492841190877856378396241,2133482811,
                   undefined,0,0,0},
       undefined,6653868})

4:42:26.520437 <0.1717.2> leo_storage_read_repairer:compare(#Ref<0.0.1.207799>, <0.1715.2>, <0.1719.2>, '[email protected]', {state,0,undefined,2,
       [{redundant_node,'[email protected]',true,true,'L'},
        {redundant_node,'[email protected]',true,true,'FL'}],
       {metadata_2,<<"test/README.md">>,
                   259282365037923196831115620348746724776,14,12487,<<>>,0,0,
                   0,0,194,1481769775994683,63648988975,
                   111724457788928492841190877856378396241,2133482811,
                   undefined,0,0,0},
       undefined,6653868})

4:42:26.521782 <0.1716.2> leo_storage_read_repairer:compare/5 --> {#Ref<0.0.1.207799>,
                                                                   ok}

4:42:26.522153 <0.1717.2> leo_storage_read_repairer:compare/5 --> {#Ref<0.0.1.207799>,
                                                                   ok}
@yosukehara
Copy link
Member

yosukehara commented Dec 19, 2016

Fixed

LeoFS' environment

$ leofs-adm status
 [System Confiuration]
-----------------------------------+----------
 Item                              | Value
-----------------------------------+----------
 Basic/Consistency level
-----------------------------------+----------
                    system version | 1.3.1
                        cluster Id | leofs_1
                             DC Id | dc_1
                    Total replicas | 2
          number of successes of R | 1
          number of successes of W | 1
          number of successes of D | 1
 number of rack-awareness replicas | 0
                         ring size | 2^128
-----------------------------------+----------
 Multi DC replication settings
-----------------------------------+----------
        max number of joinable DCs | 2
           number of replicas a DC | 1
-----------------------------------+----------
 Manager RING hash
-----------------------------------+----------
                 current ring-hash | 3923d007
                previous ring-hash | 3923d007
-----------------------------------+----------

 [State of Node(s)]
-------+--------------------------+--------------+----------------+----------------+----------------------------
 type  |           node           |    state     |  current ring  |   prev ring    |          updated at
-------+--------------------------+--------------+----------------+----------------+----------------------------
  S    | [email protected]      | running      | 3923d007       | 3923d007       | 2016-12-19 13:32:52 +0900
  S    | [email protected]      | running      | 3923d007       | 3923d007       | 2016-12-19 13:32:52 +0900
  S    | [email protected]      | running      | 3923d007       | 3923d007       | 2016-12-19 13:32:52 +0900
  S    | [email protected]      | running      | 3923d007       | 3923d007       | 2016-12-19 13:32:52 +0900
  G    | [email protected]      | running      | 3923d007       | 3923d007       | 2016-12-19 13:32:56 +0900
-------+--------------------------+--------------+----------------+----------------+----------------------------

Test result

$ ./package/leo_storage/bin/leo_storage remote_console
Erlang/OTP 18 [erts-7.3] [source] [64-bit halfword] [smp:4:4] [async-threads:10] [kernel-poll:false]

Eshell V7.3  (abort with ^G)

(storage_1@127.0.0.1)1> recon_trace:calls({leo_storage_read_repairer, compare, fun(_) -> 
                          return_trace() end}, 10, [{scope, local}]).
1

13:23:41.110822 <0.2115.0> leo_storage_read_repairer:compare(#Ref<0.0.1.10994>, 
                             <0.2114.0>, <0.2116.0>, '[email protected]', {state,0,undefined,1,
       [{redundant_node,'[email protected]',true,true,'L'},
        {redundant_node,'[email protected]',true,true,'FL'}],
       {metadata_2,<<"test/rebar.config">>,
                   321741514302956045863620177719282422959,17,1591,
                   <<131,108,0,0,0,1,104,2,109,0,0,0,22,120,45,97,109,122,45,
                     109,101,116,97,45,115,51,99,109,100,45,97,116,116,114,115,
                     109,0,0,0,142,117,105,100,58,49,48,48,48,47,103,110,97,
                     109,101,58,121,111,115,117,107,101,47,117,110,97,109,101,
                     58,121,111,115,117,107,101,47,103,105,100,58,49,48,48,48,
                     47,109,111,100,101,58,51,51,50,48,52,47,109,116,105,109,
                     101,58,49,52,56,49,49,54,48,57,56,54,47,97,116,105,109,
                     101,58,49,52,56,50,49,49,48,54,49,49,47,109,100,53,58,101,
                     56,49,100,100,50,100,97,101,102,100,57,97,54,48,97,51,101,
                     102,99,56,97,101,48,100,56,57,100,102,52,57,57,47,99,116,
                     105,109,101,58,49,52,56,49,49,54,48,57,56,54,106>>,
                   183,0,0,0,194,1482121366679264,63649340566,
                   308535748282984225827325344971067618457,958648327,
                   undefined,0,0,0},
       undefined,5716950})

13:23:41.113985 <0.2115.0> leo_storage_read_repairer:compare/5 --> {#Ref<0.0.1.10994>, ok}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants