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

Rebase postgres branch on master #2398

Open
wants to merge 341 commits into
base: master
Choose a base branch
from

Conversation

hungphan227
Copy link
Contributor

@hungphan227 hungphan227 commented Aug 30, 2024

NO MERGE

chibenwa and others added 30 commits August 30, 2024 10:40
…ing it to mpt imap test

- The PostgresMailboxSessionMapperFactoryTODO was created independent of PostgresMailboxSessionMapperFactory
for development.
We need to remove MapperFactory, and rename MapperFactoryTODO -> MapperFactory when all dependencies already.
…dSafetyTest

We do not control directly r2dbc-postgresql Connection but library owner, thus we can do nothing upon tests failure.
But we can handle library failure at James layer using PostgresExecutor wrapper.
PreparedStatement id is unique per PG connection.
We share a PG connection across multi threads leads to PreparedStatement id conflicts.
We can retry upon PreparedStatement id conflicts.
…ct exception

io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42P05] prepared statement "S_0" already exists

Should not retry upon other fatal exception e.g. database failure, invalid authorization...
Runs 41 tests more onto the PostgresMailboxManager
We generate a unique UUID so this is supported.

Note that turns 5 tests on in the PostgresMailboxManager
test suite.
- Use single query to database for fetch total + total unseen
The query looks like:

select
  count(*) as "total_count",
  count(*) filter (where is_seen = $1) as "unseen_count"
from message_mailbox
where mailbox_id = cast($2 as uuid)
- It is a why make lack of test case when run the test (jpaGuiceServerShouldUpdateQuota)
…ase sql validation

- It was created for JPA, with Postgresql we don't need it. (instead of mark @disabled for it)
Fixed by JAMES-2586 Small codestyle refactorings.
…lict

Otherwise, we could retry on other fatal errors like: io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: column "domain" of relation "mailbox" already exists.
vttranlina and others added 27 commits August 30, 2024 10:41
…MailboxMapper

-create new table MailboxMember (username, mailbox_id)
-create dao for new table
-create RLSSupportPostgresMailboxMapper to use MailboxMember
-update bindings to use RLSSupportPostgresMailboxMapper in case rls is enabled
…gresMailboxMapper

- create index for mailbox_acl column in case rls is disabled
- update findNonPersonalMailboxes method in PostgresMailboxMapper and PostgresMailboxDAO
…thod

- Update AdditionalAlterQuery in PostgresTable
- check if upsertACL actually successful
- replace batch method
- remove duplicated code in PostgresMailboxMapper and RLSSupportPostgresMailboxMapper
…ipeline - Update: disabled for cassandra weakWrite
test failed, and CassandraJamesServerMain was mark as deprecated, and will be removed in the future.
@Arsnael
Copy link
Contributor

Arsnael commented Aug 30, 2024

08:03:05,640 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project blob-postgres: Compilation failure
08:03:05,640 [ERROR] /home/jenkins/jenkins-agent/workspace/james_ApacheJames_PR-2398/server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStoreDAO.java:[157,41] cannot find symbol
08:03:05,640 [ERROR] symbol: method from(java.lang.String)
08:03:05,640 [ERROR] location: variable blobIdFactory of type org.apache.james.blob.api.BlobId.Factory

@vttranlina
Copy link
Contributor

@hungphan227 please rebase latest master
the antora pr for master was merged

@vttranlina
Copy link
Contributor

I will continue this work at pr: #2467

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.

6 participants