Skip to content

Table with no primary key seems to cause an out of memory error during schema migration #573

Open
@mightybyte

Description

@mightybyte

I'm getting the following error in what appears to be one of either verifySchema or autoMigrate.

internal error: Unable to commit 1048576 bytes of memory
    (GHC version 8.6.5 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

We ended up finding that the problem seems to be related to having a table with no primary key. The Table instance was defined like this.

 instance Table FooT where
  data PrimaryKey FooT f = FooNoId
     deriving stock (Generic)
     deriving anyclass (Beamable)
  primaryKey _ = FooNoId

But when we changed it to have a primary key, the above memory crash went away. I don't have time to dig into the details at the moment, but I wanted to record this behavior in case anyone else runs into it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions