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

LB-2095: Custom change log and -lock tables with keyspace issue #106

Merged
merged 2 commits into from
May 13, 2022

Conversation

denyskonakhevych
Copy link

@denyskonakhevych denyskonakhevych commented Oct 15, 2021

Custom change log and -lock tables with keyspace issue

┆Issue is synchronized with this Jira Bug by Unito

Custom change log and -lock tables with keyspace issue
@denyskonakhevych denyskonakhevych changed the title LB-2095: LB-2095: Custom change log and -lock tables with keyspace issue Oct 15, 2021
@denyskonakhevych
Copy link
Author

Related to #105

@lanevska
Copy link

Hi Denys. I really need those changes to be merged into the main branch as soon as possible. There is an issue I mentioned above following the copy-paste from another class. In our project we desperately need to separate changelog tables by domain. I tested your changes with the issue fix and they seem to work.
Best regards,
Anna

@denyskonakhevych
Copy link
Author

Hi Denys. I really need those changes to be merged into the main branch as soon as possible. There is an issue I mentioned above following the copy-paste from another class. In our project we desperately need to separate changelog tables by domain. I tested your changes with the issue fix and they seem to work. Best regards, Anna

Hi Anna.
If you are a regular user of this library, please be aware that this PR was ignored for more than half of the year, so I don't see the reason to keep it up to date. Probably you should for the project and use patched version on your own.
If you are an administrator of this repo - feel free to change this PR. I am currently in the besieged by Russian troops and it is quite hard to concentrate on such thing during bombarding all day long

@lanevska
Copy link

lanevska commented Mar 24, 2022

Hi Denys,

Thanks for the quick reply. I am a fellow Ukrainian from Kyiv living in London. I know very well what's going talking to my family and following the news everyday. I am also constantly wondering if our flat is still there playing a "geoguesser" in the place of destruction. I feel very sorry for you and I don't want to ask stupid questions if you are safe and everyone in your family safe. No, we are not safe like my family is not. I am very grateful to you that even in these harsh circumstances you managed to reply to me. I will try to carry out this work as I need these changes to be in.
Hope you'll make it through!
Anna

@denyskonakhevych
Copy link
Author

Hi Denys,

Thanks for the quick reply. I am a fellow Ukrainian from Kyiv living in London. I know very well what's going talking to my family and following the news everyday. I am also constantly wondering if our flat is still there playing a "geoguesser" in the place of destruction. I feel very sorry for you and I don't want to ask stupid questions if you are safe and everyone in your family safe. No, we are not safe like my family is not. I am very grateful to you that even in these harsh circumstances you managed to reply to me. I will try to carry out this work as I need these changes to be in. Hope you'll make it through! Anna

Thank you Anna. I hope it will be peace soon

@kataggart
Copy link

@lanevska @denyskonakhevych Will see if I can get some attention on this. I understand fully your need for it in context of supporting a larger scale project.

Even more, I want to also express my hope for peace and solidarity with the Ukrainian people! Liquibase Stands With Ukraine

@lanevska
Copy link

Thank you very much @kataggart for all your kind words. Please, let me know if you need any assistance from my side.

…se-cassandra into denyskonakhevych-LB-2095

# Conflicts:
#	src/main/java/liquibase/ext/cassandra/changelog/CassandraChangeLogHistoryService.java
#	src/main/java/liquibase/ext/cassandra/lockservice/LockServiceCassandra.java
@nvoxland nvoxland changed the base branch from main to 3.10.x March 29, 2022 19:43
@nvoxland nvoxland changed the base branch from 3.10.x to main March 29, 2022 19:43
@nvoxland nvoxland linked an issue Mar 29, 2022 that may be closed by this pull request
@nvoxland
Copy link
Contributor

I updated the fork from main to address the merge conflicts and fixed a couple things:

  • Renamed the getChangeLogTableName method on LockSErvice to getChangeLogLockTableName
  • Made sure we were using liquibaseCatalogName not defaultCatalogName everywhere.

I don't have a great cassandra test env at the moment. Could @lanevska or @denyskonakhevych or someone make sure the attached jar (renamed as a zip for github reasons) still works for you? Then we can get it merged in and released.

liquibase-cassandra-4.9.1-SNAPSHOT.zip

@lanevska
Copy link

Hi @nvoxland,

Thanks for submitting the changes. I tested them today. Please, proceed with the merge.
Best regards,
Anna

@lanevska
Copy link

lanevska commented Apr 5, 2022

Hi! Could you, please, merge these changes to the main branch?

Best regards,
Anna

1 similar comment
@lanevska
Copy link

lanevska commented Apr 5, 2022

Hi! Could you, please, merge these changes to the main branch?

Best regards,
Anna

@denyskonakhevych
Copy link
Author

denyskonakhevych commented Apr 6, 2022

Hi all.
Sorry for the long delay in communication.
As I see, PR is approved and has no conflicts, but..
Only those with write access to this repository can merge pull requests.
So we need to find someone with write permissions

@denyskonakhevych
Copy link
Author

I would like also put attentions with concurrency issues when I used liquibase: #108
Should we also prioritise this?

@lanevska
Copy link

lanevska commented Apr 7, 2022

Dear @kataggart and @nvoxland,
Any timeline when this is going to be merged to the main branch?

Best regards,
Anna

@lanevska
Copy link

Hi @kataggart and @nvoxland,
I hope you are all well. As usual I am asking for an update when you are going to merge this change.
I found another issue related to Simba driver. This is a proprietary driver by Datastax that we use for Cassandra so I am wondering if all other teams using Liquibase are bound to use this one.
Could you clarify that, please?

private static Connection connectViaDS() throws Exception { Connection connection = null; DataSource ds = new com.simba.cassandra.jdbc42.DataSource(); ds.setURL(CONNECTION_URL); connection = ds.getConnection(); return connection; }

When getConnection method is invoked it throws a ClassCastException:
Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Error creating Driver, Driver class name incorrect. at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:271) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ... 18 common frames omitted Caused by: java.sql.SQLException: Error creating Driver, Driver class name incorrect. at com.simba.cassandra.jdbc.common.AbstractDataSource.doInitialize(Unknown Source) at com.simba.cassandra.jdbc.common.AbstractDataSource.getSimbaConnection(Unknown Source) at com.simba.cassandra.jdbc.common.AbstractDataSource.getConnection(Unknown Source) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:266) ... 20 common frames omitted Caused by: com.simba.cassandra.support.exceptions.GeneralException: Error creating Driver, Driver class name incorrect. at com.simba.cassandra.dsi.core.impl.DSIDriverFactory.createDriver(Unknown Source) ... 24 common frames omitted Caused by: java.lang.ClassCastException: class com.simba.cassandra.jdbc42.Driver cannot be cast to class com.simba.cassandra.dsi.core.interfaces.IDriver (com.simba.cassandra.jdbc42.Driver and com.simba.cassandra.dsi.core.interfaces.IDriver are in unnamed module of loader 'app') ... 25 common frames omitted

Best regards,
Anna

@lanevska
Copy link

Hi @kataggart and @nvoxland,

Could you provide any update on this request, please? It's been a while this one is ready to be merged? Is there any reason for a delay?

Best regards,
Anna

@lanevska
Copy link

Hi guys,

I hope you are all well. Do you have any update on this matter? What is the issue preventing you from the merge?

Best regards,
Anna

@lanevska
Copy link

lanevska commented May 3, 2022

Hi everyone,

Is there any issue with the merge? I need this feature ASAP. It's a top priority now for our project. I am begging you...

@eledhwen
Copy link

eledhwen commented May 5, 2022

Hey there, just a quick bump to say that we're currently working on several projects that would benefit from this, and as far as I understand this patch has been ready for quite some time now.

@lanevska
Copy link

lanevska commented May 13, 2022

Hi @nvoxland, @kataggart and @r2liquibase!

I hope that you are well. When can you make this change? We are facing a delay in the project because of this issue. I don't know how to escalate. Please, understand that there are other customers who require this and we would be really grateful to all of you!

Anna

@r2-lf
Copy link
Contributor

r2-lf commented May 13, 2022

@lanevska Are you a Liquibase Pro customer? Liquibase Pro customers have their issues immediately escalated. Happy to help!

@datavaggio
Copy link

That doesn't answer much of @lanevska questions above.

This has been approved on the 29th of March, are you implying that only Pro customers get to see an already approved contribution merged in a decent timeframe? Does it need to be "escalated" at all to get an answer as to if this has been prioritized, and if not, when it is expected to be?

@kataggart
Copy link

sorry for delays -- taking a look again and will get back to everyone

@nvoxland nvoxland merged commit a260ec5 into liquibase:main May 13, 2022
@kataggart
Copy link

@lanevska -

Again, our apologies for not merging this sooner. It is now merged, so you can build on your end if you would like to use it now. We are very likely to do a full release of core and the extensions next week.

Are you still looking for an answer to the Simba question you posted in this thread as well? Let me know and I will open a separate issue so we don't accidentally lose that thread.

@denyskonakhevych
Copy link
Author

Hi @nvoxland, @kataggart and @r2liquibase!
Thank you for the response and merge.

I would like to also put your attention on concurrency issue with locking.
Here is the issue describing it and possible fix.

@lanevska
Copy link

Hi @kataggart,

Thank you for sorting that out. Could you provide the timeline for the release containing this change, please?
Regarding Simba driver issue, I contacted Magnitude support and here is the snippet that works for me using 42version of the driver:
liquibase.url="jdbc:cassandra://ReplaceCassandraNode:ReplaceDbPort;DefaultKeyspace=ReplaceKeyspace;UID=ReplaceUserDomain\ReplaceDbUser;PWD=ReplaceDbSecret;SSLMode=1;UseSslIdentityCheck=0;AuthMech=1;SSLTruststorePath=ReplaceSslTruststorePath"

`

    Class.forName("com.simba.cassandra.jdbc42.Driver");

    String simbaDriverUrl = liquibaseProperties.getUrl()
        .replace("ReplaceCassandraNode", cassDbProperties.getCassandraNodes().split(",")[0].trim())
        .replace("ReplaceDbPort", String.valueOf(cassDbProperties.getPort()))
        .replace("ReplaceKeyspace", liquibaseProperties.getDefaultSchema())
        .replace("ReplaceUserDomain", cassDbProperties.getUserDomain())
        .replace("ReplaceDbUser", user)
        .replace("ReplaceDbSecret", secret)
        .replace("ReplaceSslTruststorePath", cassDbProperties.getTrustStore());

    com.simba.cassandra.jdbc42.DataSource ds = new com.simba.cassandra.jdbc42.DataSource();
    ds.setURL(simbaDriverUrl);

`

Documentation for the latest version didn't contain the line Class.forName("com.simba.cassandra.jdbc42.Driver"); but it was used in the previous versions.

Best regards,
Anna

@santoshtrip
Copy link

Hi @kataggart,

Thank you for sorting that out. Could you provide the timeline for the release containing this change, please? Regarding Simba driver issue, I contacted Magnitude support and here is the snippet that works for me using 42version of the driver: liquibase.url="jdbc:cassandra://ReplaceCassandraNode:ReplaceDbPort;DefaultKeyspace=ReplaceKeyspace;UID=ReplaceUserDomain\ReplaceDbUser;PWD=ReplaceDbSecret;SSLMode=1;UseSslIdentityCheck=0;AuthMech=1;SSLTruststorePath=ReplaceSslTruststorePath"

`

    Class.forName("com.simba.cassandra.jdbc42.Driver");

    String simbaDriverUrl = liquibaseProperties.getUrl()
        .replace("ReplaceCassandraNode", cassDbProperties.getCassandraNodes().split(",")[0].trim())
        .replace("ReplaceDbPort", String.valueOf(cassDbProperties.getPort()))
        .replace("ReplaceKeyspace", liquibaseProperties.getDefaultSchema())
        .replace("ReplaceUserDomain", cassDbProperties.getUserDomain())
        .replace("ReplaceDbUser", user)
        .replace("ReplaceDbSecret", secret)
        .replace("ReplaceSslTruststorePath", cassDbProperties.getTrustStore());

    com.simba.cassandra.jdbc42.DataSource ds = new com.simba.cassandra.jdbc42.DataSource();
    ds.setURL(simbaDriverUrl);

`

Documentation for the latest version didn't contain the line Class.forName("com.simba.cassandra.jdbc42.Driver"); but it was used in the previous versions.

Best regards, Anna

I am facing the similar issue initializing the DataSource with Simba driver in my springboot app.Is there a way to just have the right url which can be set to the dataSource to acquire the connection.

My code as below:
com.simba.cassandra.jdbc42.DataSource ds = new com.simba.cassandra.jdbc42.DataSource();
SpringLiquibase liquibase = new SpringLiquibase();
ds.setURL(dataSourceUrl);
//dataSourceUrl = jdbc:cassandra://localhost:9042;AuthMech=1;DefaultKeyspace=demo
ds.setUserID("demo_migration");
ds.setPassword("rollingstones");
liquibase.setDataSource(ds);

@kataggart
Copy link

@lanevska this fix was released months ago, are you still seeing the same issue?

I'll open a new issue based on your comment above, since this one is closed and we don't want to miss it.

@lanevska
Copy link

Hi @kataggart!

My code snippet worked fine. Thanks to your support we debugged all the issues. I believe a key here is to put the line: Class.forName("com.simba.cassandra.jdbc42.Driver"); Without registering the driver it won't work.

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.

Custom change log and -lock tables with keyspace issue
8 participants