Skip to content

There are a lot of logs as CREATE TABLE IF NOT EXISTS "_SCHEMA" #7021

Closed
@JeffGuKang

Description

@JeffGuKang

New Issue Checklist

Issue Description

There are a lot of log as CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )

And My DB connection pool is higher at the time.

I am not sure it makes some problem to the DB
or
the logs are made a lot when DB connection has a problem.

statement: CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )

image

I found some related query in PostgreAdopter:

async _ensureSchemaCollectionExists(conn: any) {
conn = conn || this._client;
await conn
.none(
'CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )'
)
.catch(error => {
if (
error.code === PostgresDuplicateRelationError ||
error.code === PostgresUniqueIndexViolationError ||
error.code === PostgresDuplicateObjectError
) {
// Table already exists, must have been created by a different request. Ignore error.
} else {
throw error;
}
});
}

Steps to reproduce

  1. Checking postgreSQL logs on the RDS.

  2. The log is shown around every 30 secs

  3. But sometimes there are too many logs when backend server requests a lot.

Actual Outcome

Expected Outcome

Environment

This is my Parse config.

const parseConfig = {
  cloud: __dirname + '/src/cloud/', // location after tsc
  appId: process.env.APP_ID,
  masterKey: process.env.MASTER_KEY,
  fileKey: process.env.FILE_KEY,
  serverURL: 'http://localhost:1337/parse', 
  auth: {
    kakao: kakaoAuthAdapter,
    apple: {
      client_id: process.env.APPLE_SIGNIN_CLIENT_ID, // optional (for extra validation), use the Service ID from Apple.
    },
  },
  maxUploadSize: '5mb',
  logLevel: process.env.NODE_ENV !== 'development' ? 'warn' : undefined,
  schemaCacheTTL: 1000 * 60 * 60 * 24 * 15, // 15 days
  cacheTTL: 1000 * 60 * 60 * 24 * 15, // 15 days
  allowClientClassCreation: false,
  enableSingleSchemaCache: true,
  enableExpressErrorHandler: false,
}

  const redisOptions = {url: 'redis://' + process.env.REDIS_CACHE_URL}
  const redisCache = new RedisCacheAdapter(redisOptions)

  parseConfig.cacheAdapter = redisCache

Server

  • Parse Server version: 4.4.0
  • Operating system: FILL_THIS_OUT
  • Local or remote host : AWS scalable server (EC2)

Database

  • System (MongoDB or Postgres): Postgres
  • Database version: 11+
  • Local or remote host: AWS Aurora postgres

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): iOS, Android
  • SDK version: FILL_THIS_OUT

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions