@@ -686,6 +686,8 @@ function M.upgrade(space,opts,depth)
686686 end
687687 end
688688
689+ self .ready = fiber .channel (0 )
690+
689691 if opts .worker then
690692 local workers = opts .workers or 1
691693 local worker = opts .worker
@@ -697,6 +699,10 @@ function M.upgrade(space,opts,depth)
697699 repeat fiber .sleep (0.001 ) until space .xq
698700 if xq .ready then xq .ready :get () end
699701 log .info (" I am worker %s" ,i )
702+ if box .info .ro then
703+ log .notice (" Shutting down on ro instance" )
704+ return
705+ end
700706 while box .space [space .name ] and space .xq == xq do
701707 local task = space :take (1 )
702708 if task then
@@ -731,6 +737,10 @@ function M.upgrade(space,opts,depth)
731737 if xq .ready then xq .ready :get () end
732738 local chan = xq .runat_chan
733739 log .info (" Runat started" )
740+ if box .info .ro then
741+ log .notice (" Shutting down on ro instance" )
742+ return
743+ end
734744 local maxrun = 1000
735745 local curwait
736746 local collect = {}
@@ -881,7 +891,6 @@ function M.upgrade(space,opts,depth)
881891 end
882892 self .ready = nil
883893 end
884- self .ready = fiber .channel (0 )
885894
886895 local meta = debug.getmetatable (space )
887896 for k ,v in pairs (methods ) do meta [k ] = v end
0 commit comments