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

Conflict on primary key when reseting sequence on postgres #39

Open
dgsb opened this issue Nov 5, 2018 · 0 comments
Open

Conflict on primary key when reseting sequence on postgres #39

dgsb opened this issue Nov 5, 2018 · 0 comments
Assignees

Comments

@dgsb
Copy link
Contributor

dgsb commented Nov 5, 2018

Somehow, primary key conflict occurs when sequence are used as primary key default value.
It happens when tests are run several time.
As workaround an option has been added to the postgres helper to no reset sequences #38
This issue is opened to track the root cause of the problem which have not been completely identified.

zeripath added a commit to zeripath/gitea that referenced this issue Jan 20, 2019
The integration tests are being affected by
go-testfixtures/testfixtures#39 if we set the
primary key high enough, keep a count of this and remove at the end of
each test we shouldn't be affected by this.
lafriks pushed a commit to go-gitea/gitea that referenced this issue Jan 23, 2019
* Pooled and buffered gzip implementation

* Add test for gzip

* Add integration test

* Ensure lfs check within transaction

The previous code made it possible for a race condition to occur whereby a LFSMetaObject could be checked into the database twice. We should check if the LFSMetaObject is within the database and insert it if not in one transaction.

* Try to avoid primary key problem in postgres

The integration tests are being affected by
go-testfixtures/testfixtures#39 if we set the
primary key high enough, keep a count of this and remove at the end of
each test we shouldn't be affected by this.
bmackinney pushed a commit to bmackinney/gitea that referenced this issue Jan 27, 2019
* Pooled and buffered gzip implementation

* Add test for gzip

* Add integration test

* Ensure lfs check within transaction

The previous code made it possible for a race condition to occur whereby a LFSMetaObject could be checked into the database twice. We should check if the LFSMetaObject is within the database and insert it if not in one transaction.

* Try to avoid primary key problem in postgres

The integration tests are being affected by
go-testfixtures/testfixtures#39 if we set the
primary key high enough, keep a count of this and remove at the end of
each test we shouldn't be affected by this.
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