Skip to content

Fix: fix duplicate entry during indexation (alternative approach) - #2743

Merged
Koc merged 1 commit into
mainfrom
bugfix/fix-duplicate-entry-for-alternative-approach
Nov 2, 2026
Merged

Koc merged 1 commit into
mainfrom
bugfix/fix-duplicate-entry-for-alternative-approach

Conversation

@Koc

@Koc Koc commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

📝 Summary

This is alternative approach to fix #1886, #2405. Even after #2451 we observe tons of logs on PostgreSQL side related to duplication. In this PR this logs are gone

🗒️ Next steps

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@mejo-

mejo- commented Sep 8, 2026

Copy link
Copy Markdown
Member

@Koc thanks, this looks very promising. I didn't even know about insertIgnoreConflict(). Could you adjust VersionsBackend.php as well and replace the try/catch with it?

@Koc

Koc commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@mejo- sure, give me few days and I will finalize current PR

@Koc
Koc force-pushed the bugfix/fix-duplicate-entry-for-alternative-approach branch from 658883e to 9e8f94d Compare September 12, 2026 16:10
@Koc
Koc marked this pull request as ready for review September 12, 2026 16:27

@mejo- mejo- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @Koc. One question/comment.

Comment thread lib/Db/TInsertIgnoreConflict.php Resolved
@Koc
Koc force-pushed the bugfix/fix-duplicate-entry-for-alternative-approach branch from 9e8f94d to f5a7bbf Compare September 26, 2026 14:44
@Koc

Koc commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

@mejo- @max-nextcloud mates, what blocks us from merging of this PR?

@Koc
Koc force-pushed the bugfix/fix-duplicate-entry-for-alternative-approach branch from f5a7bbf to f50973e Compare October 12, 2026 07:57
@Koc
Koc force-pushed the bugfix/fix-duplicate-entry-for-alternative-approach branch from f50973e to b1820e3 Compare October 31, 2026 12:01
Use IDBConnection::insertIgnoreConflict() so concurrent inserts into
collectives_s_docs, collectives_s_files and collectives_p_versions no
longer produce duplicate key errors in the database log.

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
@mejo-
mejo- force-pushed the bugfix/fix-duplicate-entry-for-alternative-approach branch from b1820e3 to d19646d Compare November 2, 2026 13:59
@Koc
Koc merged commit 080367a into main Nov 2, 2026
64 checks passed
@Koc
Koc deleted the bugfix/fix-duplicate-entry-for-alternative-approach branch November 2, 2026 15:57
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

Successfully merging this pull request may close these issues.

Duplicate entry '...' for key 'c_p_versions_uniq_idx'

2 participants