anchor.diff:          {ok, finish, List} ->
               do_handle(List, RunMode, RunArgs),
               ?INFO_MSG("Scan finish with finish:s=~p", [ {RedisHost,RedisPort}]),
  +            application:set_env(message_store, {codis_scan_result, RunMode, self()}, ok),
               ok;
           {ok, Next, List}->
               do_handle(List, RunMode, RunArgs),
               ?MODULE:do_scan(RedisHost, RedisPort, RunMode, RunArgs, Next, MaxScan-1);
           {error, Error} ->
               ?INFO_MSG("Scan finish with Error:~p,s=~p", [Error, {RedisHost,RedisPort}]),
  +            application:set_env(message_store, {codis_scan_result, RunMode, self()}, {error, Error}),
               {error, Error}
       end;
  -do_scan(RedisHost, RedisPort, _RunMode, _RunArgs, _Cursor, _MaxScan) ->
  +do_scan(RedisHost, RedisPort, RunMode, _RunArgs, _Cursor, _MaxScan) ->
       ?INFO_MSG("Scan finish with :~p,s=~p", [max_scan, {RedisHost,RedisPort}]),
  +    application:set_env(message_store, {codis_scan_result, RunMode, self()}, ok),
       ok.
   
   
  
positive.code:          do_scan/6,
           do_handle_key/3,
           start_from_codis/2,
           stop_all/1
  ]).
  
  -define(SCAN_COUNT, 1000).
  
negative.code: 
  stop() ->
      stop_all(delete_bad_user_session).
  
  is_running() ->
      Pids = application:get_env(message_store, {codis_scan_pid_list, delete_bad_user_session}, []),
      case [Pid||Pid<-Pids, is_process_alive(Pid)] of
          [] ->
              false;
          _ ->
              true
      end.
  
  is_good_exit() ->
      RunMode = delete_bad_user_session,
      Pids = application:get_env(message_store, {codis_scan_pid_list, RunMode}, []),
      case [Pid||Pid<-Pids, 
              not is_process_alive(Pid), 
              application:get_env(message_store, {codis_scan_result, RunMode, Pid}, exit) /= ok] of
          [] -> true;
          _ ->
              false
      end.
  
  scan(Host, Port, CodisOrRedis, RunMode, RunArgs, MaxScan) ->
      stop_all(RunMode),
      ServerList = server_list(Host, Port, CodisOrRedis),
  