summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-30 09:31:12 +0300
committerPaul Buetow <paul@buetow.org>2025-06-30 09:31:12 +0300
commit38ed252e1a85c6d9a17cb7e244737c6f1d93d4d8 (patch)
tree88a37348af9d0d0aeffceddde405f995a48be2be /internal
parentabff8dc92abddfcc032363623914879d1aedd1c8 (diff)
fix: disable turbo boost for MapReduce operations in server mode
The turbo boost optimization introduced in commit 6afc304 causes a panic when processing MapReduce operations in server mode. The optimized reader's periodicTruncateCheck function attempts to send on a closed channel, resulting in incomplete MapReduce results. This fix disables turbo boost specifically for MapReduce (aggregate) operations while keeping it enabled for regular cat/grep/tail operations. The traditional channel-based approach is required for MapReduce to function correctly. Fixes TestDMap3 integration test failures when DTAIL_TURBOBOOST_ENABLE=yes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/server/handlers/readcommand.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/server/handlers/readcommand.go b/internal/server/handlers/readcommand.go
index 3d74e52..2245b7c 100644
--- a/internal/server/handlers/readcommand.go
+++ b/internal/server/handlers/readcommand.go
@@ -176,9 +176,10 @@ func (r *readCommand) read(ctx context.Context, ltx lcontext.LContext,
dlog.Server.Info(r.server.user, "Turbo boost check: enabled=", turboBoostEnabled, "mode=", r.mode)
// Only enable channel-less for server mode, not serverless mode
// Use the serverless field directly as it's more reliable
- // Enable turbo boost for cat/grep/tail modes, and also when aggregate (MapReduce) is present
- if turboBoostEnabled && !r.server.serverless &&
- (r.mode == omode.CatClient || r.mode == omode.GrepClient || r.mode == omode.TailClient || r.server.aggregate != nil) {
+ // Enable turbo boost for cat/grep/tail modes, but NOT for aggregate (MapReduce) operations
+ // MapReduce requires the traditional channel-based approach to work correctly
+ if turboBoostEnabled && !r.server.serverless && r.server.aggregate == nil &&
+ (r.mode == omode.CatClient || r.mode == omode.GrepClient || r.mode == omode.TailClient) {
// Log to stderr for testing verification - only in server mode
fmt.Fprintf(os.Stderr, "[DTAIL] Turbo boost enabled: using channel-less implementation for %s\n", path)
r.readWithProcessor(ctx, ltx, path, globID, re, reader)