Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: Out of memory when fetching aggregates with most recent contract transactions #254

Open
3 tasks done
MBeliou opened this issue Mar 22, 2023 · 0 comments
Open
3 tasks done

Comments

@MBeliou
Copy link

MBeliou commented Mar 22, 2023

Prerequisites

Expected Behavior

Running the query should return a result

Current Behavior

We get some sort of out of memory exception

{
  "errors": [
    {
      "message": "could not resize shared memory segment \"/PostgreSQL.2197826890\" to 8388608 bytes: No space left on device",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "executeContractMessages"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "length": 166,
          "name": "error",
          "severity": "ERROR",
          "code": "53100",
          "file": "dsm_impl.c",
          "line": "311",
          "routine": "dsm_impl_posix",
          "stacktrace": [
            "error: could not resize shared memory segment \"/PostgreSQL.2197826890\" to 8388608 bytes: No space left on device",
            "    at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)",
            "    at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)",
            "    at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)",
            "    at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)",
            "    at Socket.emit (node:events:527:28)",
            "    at addChunk (node:internal/streams/readable:315:12)",
            "    at readableAddChunk (node:internal/streams/readable:289:9)",
            "    at Socket.Readable.push (node:internal/streams/readable:228:10)",
            "    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)",
            "    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)"
          ]
        }
      }
    }
  ],
  "data": {
    "executeContractMessages": null
  }
}

Steps To Reproduce

You only need to run this query on mainnet subquery

query lastweek_mostUsedContracts {
  executeContractMessages(
    first: 100
    orderBy: EXECUTE_CONTRACT_MESSAGES_BY_BLOCK_HEIGHT_DESC
    filter: { block: { height: { greaterThan: "10030799" } } }
  ) 
  {
    totalCount

    nodes {
      contract
      funds
      transaction {
        gasUsed
        fees
      }
    }
    contractAggregate: groupedAggregates(groupBy: CONTRACT) {
      keys

      distinctCount {
        id
      }
    }
  }
}

Context

Running the query on mainnet fetch.ai subquery

Failure Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant