{"record":{"id":"3f077b76cf16b832","repo":"prestodb/presto","slug":"missing-data","errorCode":"MISSING_DATA","errorMessage":"Failed to find table on a worker.","messagePattern":"Failed to find table on a worker\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":500,"severity":"error","filePath":"presto-memory/src/main/java/com/facebook/presto/plugin/memory/MemoryPagesStore.java","lineNumber":62,"sourceCode":"    private final Map<Long, TableData> tables = new HashMap<>();\n\n    @Inject\n    public MemoryPagesStore(MemoryConfig config)\n    {\n        this.maxBytes = config.getMaxDataPerNode().toBytes();\n    }\n\n    public synchronized void initialize(long tableId)\n    {\n        if (!tables.containsKey(tableId)) {\n            tables.put(tableId, new TableData());\n        }\n    }\n\n    public synchronized void add(Long tableId, Page page)\n    {\n        if (!contains(tableId)) {\n            throw new PrestoException(MISSING_DATA, \"Failed to find table on a worker.\");\n        }\n\n        page.compact();\n\n        long newSize = currentBytes + page.getRetainedSizeInBytes();\n        if (maxBytes < newSize) {\n            throw new PrestoException(MEMORY_LIMIT_EXCEEDED, format(\"Memory limit [%d] for memory connector exceeded\", maxBytes));\n        }\n        currentBytes = newSize;\n\n        TableData tableData = tables.get(tableId);\n        tableData.add(page);\n    }\n\n    public synchronized List<Page> getPages(\n            Long tableId,\n            int partNumber,\n            int totalParts,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-memory/src/main/java/com/facebook/presto/plugin/memory/MemoryPagesStore.java#L44-L80","documentation":"MemoryPagesStore.add throws MISSING_DATA when the page's tableId is not present in this worker's page store (contains(tableId) is false). The memory connector keeps table data only on the worker that created the table handle; if a page arrives at a worker that never saw the table creation, data routing is broken.","triggerScenarios":"Writing pages for a table whose TableHandle was created on a different worker; worker restart/loss between table creation and insert; split dispatched to the wrong node in a multi-node memory-connector deployment.","commonSituations":"Running the memory connector on a multi-node cluster where table data must be pinned to one worker; worker failure mid-insert; cluster resize during a query.","solutions":["Run memory-connector workloads single-node, or configure table creation so data is created on the coordinator/creator node (memory connector pins tables to their creating node).","Retry the query — a worker restart mid-query is transient; resubmit the statement.","Check worker logs for restarts/failures around the failing query.","Avoid elastic scaling (node add/remove) while memory-connector inserts are in flight."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { insert(...) } catch (PrestoException e) { if (MISSING_DATA.equals(e.getErrorCode()) && e.getMessage().contains(\"Failed to find table on a worker\")) { retryWithBackoffOrResubmit(); } else throw e; }","preventionTips":["Run the memory connector single-node or pin tables to their creating worker","Avoid worker restarts/autoscaling during memory-table writes"],"tags":["presto","memory-connector","distributed","missing-data"],"backgroundTag":"table-not-on-worker","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}