Repository navigation
fix(postgres/conectionmanager): Don't leak OIDs between instances - #9025
Merged
Merged
Conversation
sushantdhiman
approved these changes
Feb 9, 2018
sushantdhiman
left a comment
Contributor
There was a problem hiding this comment.
oid for these dynamic objects can be different for different database instances so this was always a possibility
mickhansen
approved these changes
Feb 9, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This problem happens under the following circumstances:
Since the two sequelize instances share the same copy of the pg lib, they will overwrite each others' type parsers. This is especially appearent when the datatype in one db is an array, and the other is not - So suddenly what you expect to be a string is now an array.
I've fixed this by keeping a local copy of the oids on the connection manager and setting the type parser on the pg client instance, instead of mutating the pg-types object.
Tested on snaplytics, where it fixed the bug that suddenly an enum type became an array.