Conversation
|
not a refactor :P |
4e72316 to
4743389
Compare
| print_linked_processes() -> | ||
| couch_debug:print_linked_processes(couch_index_server). | ||
|
|
||
| -spec busy(Thershold :: pos_integer()) -> |
There was a problem hiding this comment.
This is not couch_index_server specific. Therefore I am considering to move it into couch_debug.erl for reuse. With a slight change in funuction signature. It would become busy(Threshold, ProcessList) -> [proccess_name()].
| names() | ||
| ). | ||
|
|
||
| -spec restart_busy(Threshold :: pos_integer()) -> |
There was a problem hiding this comment.
I think I should move it into couch_debug.erl for re-use.
| Pid :: pid() | timeout. | ||
|
|
||
| restart(Name) -> | ||
| Res = test_util:with_process_restart(Name, fun() -> |
There was a problem hiding this comment.
Note: I am calling a function from test_util module. Is it worth to move the with_process_restart (and friends) into couch_debug and create a dispatch in test_util?
There was a problem hiding this comment.
The main downside IMO to moving them is that with_process_restart uses the same sneaky trick with respect to time units as test_util:wait and friends, so keeping them together might be slightly less bewildering to someone unfamiliar with that code. I'm pretty neutral, though, and just wish all implementations were a bit less sneaky.
jaydoane
left a comment
There was a problem hiding this comment.
Followed testing instructions, and seems to work as expected.
src/couch/src/couch_debug.erl
Outdated
|
|
||
| If Property is not specified we use message box size | ||
|
|
||
| Properties which can be used are listed bellow |
src/couch/src/couch_debug.erl
Outdated
|
|
||
| If Property is not specified we use message box size | ||
|
|
||
| Properties which can be used are listed bellow |
src/couch/src/couch_debug.erl
Outdated
| io:format(" ---~n", []), | ||
| ok. | ||
|
|
||
| -spec busy(ProcessList :: [process_name()], Thershold :: pos_integer()) -> |
src/couch/src/couch_debug.erl
Outdated
| busy(ProcessList, Threshold, message_queue_len). | ||
|
|
||
| -spec busy( | ||
| ProcessList :: [process_name()], Thershold :: pos_integer(), Property :: busy_properties() |
| Pid :: pid() | timeout. | ||
|
|
||
| restart(Name) -> | ||
| Res = test_util:with_process_restart(Name, fun() -> |
There was a problem hiding this comment.
The main downside IMO to moving them is that with_process_restart uses the same sneaky trick with respect to time units as test_util:wait and friends, so keeping them together might be slightly less bewildering to someone unfamiliar with that code. I'm pretty neutral, though, and just wish all implementations were a bit less sneaky.
| end. | ||
|
|
||
| -spec restart_busy(ProcessList :: [process_name()], Threshold :: pos_integer()) -> | ||
| throw({timeout, Name :: process_name()}). |
There was a problem hiding this comment.
does this also return ok?
(node1@127.0.0.1)28> couch_index_debug:restart_busy(4000, 50, reductions).
ok
|
|
||
| If Property is not specified we use message box size | ||
|
|
||
| Properties which can be used are listed bellow |
|
|
||
| If Property is not specified we use message box size | ||
|
|
||
| Properties which can be used are listed bellow |
3879f10 to
3412a96
Compare
Overview
Recent refactor of
couch_index_servermade it a sharded implementation. This means multiple processes are in play now. This made it somewhat harder to bounce in production in case of problems. Also thecouch_debug:print_linked_processes(couch_index_server)had an assumption thatcouch_index_serveris a single process.This PR does two very related things
couch_debug:print_linked_processes(couch_index_server)couch_index_debugmodule with auxiliary functions to restartcouch_index_serverprocesses safely.Testing recommendations
couch_debug:print_linked_processes(couch_index_server).couch_index_debug:help().couch_index_debug:help(names)couch_index_debug:help(print_linked_processes)couch_index_debug:help(busy)couch_index_debug:help(restart_busy)whereis(index_server_8).and docouch_index_debug:restart(index_server_8)couch_debug:print_linked_processes(couch_index_server).to select a value for areductionproperty somewhere in between. Then callcouch_index_debug:restart_busy(SelectedValue, 50, reductions).. Finally usecouch_debug:print_linked_processes(couch_index_server).and verify pids of someindex_server_xprocesses change.Related Issues or Pull Requests
Checklist
rel/overlay/etc/default.ini