Skip to content

Commit afec422

Browse files
Fix map reduces counter
Since wrap reload may execute functions multiple times, multiple map reduces may be planned and executed. Follows up #224
1 parent ee5586b commit afec422

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

crud/select/compat/select.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ local function build_select_iterator(space_name, user_conditions, opts)
115115
end
116116
else
117117
local context_stats = fiber_context.init_section('router_stats')
118-
context_stats.map_reduces = 1
118+
if context_stats.map_reduces == nil then
119+
context_stats.map_reduces = 0
120+
end
121+
context_stats.map_reduces = context_stats.map_reduces + 1
119122
end
120123

121124
local tuples_limit = opts.first

crud/select/compat/select_old.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ local function build_select_iterator(space_name, user_conditions, opts)
150150
end
151151
else
152152
local context_stats = fiber_context.init_section('router_stats')
153-
context_stats.map_reduces = 1
153+
if context_stats.map_reduces == nil then
154+
context_stats.map_reduces = 0
155+
end
156+
context_stats.map_reduces = context_stats.map_reduces + 1
154157
end
155158

156159
-- generate tuples comparator

0 commit comments

Comments
 (0)