这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@tirumaraiselvan
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan commented Feb 18, 2020

Description

Currently, we are using Serializable tx isolation levels for all system processes. This is not required as most (one exception is catalog migration) of the system processes are either single statement read or write i.e (no repeated reads). Reducing the tx isolation level of such processes is generally good.

Affected components

  • Server

Related Issues

#660

@hasura-bot
Copy link
Contributor

Review app for commit 0c1957f deployed to Heroku: https://hge-ci-pull-3901.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3901-0c1957f0

@0x777 0x777 added the c/server Related to server label Mar 24, 2020
Copy link
Contributor

@lexi-lambda lexi-lambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve left one small comment, but otherwise this LGTM.

Comment on lines 216 to 217
schemaCache <- onNothing _icRebuildableSchemaCache
(printErrExit "expected schema cache to be initialised")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably just pass the schema cache as a separate argument to this function rather than include it in the InitCtx wrapped in a Maybe. That way the type system can prevent this error from ever happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema cache is now part of InitCtx{..} and is of type Maybe (RebuildableSchemaCache Run). It is is a Maybe because we get InitCtx{..} from initialiseCtx which is used in operations which do not require the schema cache to be initialised like HCExport, HCClean.

We can take schema cache outside of InitCtx{..} ofcourse but I felt it is better to be here.

Thoughts?

@tirumaraiselvan tirumaraiselvan requested a review from a team as a code owner April 7, 2020 09:40
@hasura-bot
Copy link
Contributor

Review app for commit b95b9bb deployed to Heroku: https://hge-ci-pull-3901.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3901-b95b9bb1

@netlify
Copy link

netlify bot commented Apr 8, 2020

Deploy preview for hasura-docs ready!

Built with commit 860b013

https://deploy-preview-3901--hasura-docs.netlify.com

Copy link
Contributor

@lexi-lambda lexi-lambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve pushed a change that moves the schema cache initialization logic into mkWaiApp to avoid worrying about it at all inside initialiseCtx, since it isn’t needed until that point anyway. Let me know if my changes look okay to you.

@hasura-bot
Copy link
Contributor

Review app for commit e7edb94 deployed to Heroku: https://hge-ci-pull-3901.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3901-e7edb94e

Doing this earlier would run it before the catalog was migrated, causing
an error.
@hasura-bot
Copy link
Contributor

Review app for commit a1509cc deployed to Heroku: https://hge-ci-pull-3901.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3901-a1509cc8

getTimeMs :: IO Int64
getTimeMs = (round . (* 1000)) `fmap` getPOSIXTime

initialiseSchemaCache :: m (E.PlanCache, SchemaCacheRef, Maybe UTCTime)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to reflect that this also migrates catalog (if required)? Or split the catalog migration into a different top-level function?

The reason being at some point (in near future) we might want to run a check if catalog migration is required (using a different txiso level) and then skip it (that will solve #660)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to migrateAndInitialiseSchemaCache.

@hasura-bot
Copy link
Contributor

Review app for commit be2c6fb deployed to Heroku: https://hge-ci-pull-3901.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3901-be2c6fb3

@lexi-lambda lexi-lambda merged commit ca15ef8 into hasura:master Apr 9, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-3901.herokuapp.com is deleted

codingkarthik pushed a commit to lexi-lambda/graphql-engine that referenced this pull request Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants