Re: *URGENT* Migration across different Cassandra cluster few having same keyspace/table names

2020-01-17 Thread Upasana Sharma
Hi,

Did you consider adding Cassandra nodes from cluster B,  into cluster A as
a different data center ?

Your keyspace would than be on Network topology data strategy.

In this case, all data can be synced between both data centers by Cassandra
using rebalancing.


At client/application level you will have to ensure local quorum/ local
consistency  so that there is no impact on latencies.

Once you have moved data applications to new cluster , you can then remove
the old data center (cluster A),  and cluster B would have fresh data.




On Fri, Jan 17, 2020, 6:59 PM Ankit Gadhiya  wrote:

> Thanks but there’s no DSE License.
> Wondering how sstableloader will help as some oh the Keyspace and tables
> names are same. Also how do i sync few system keyspaces.
>
>
> Thanks & Regards,
> Ankit
>
> On Fri, Jan 17, 2020 at 1:11 AM Vova Shelgunov  wrote:
>
>> Loader*
>>
>> https://www.datastax.com/blog/2018/05/introducing-datastax-bulk-loader
>>
>> On Fri, Jan 17, 2020, 09:09 Vova Shelgunov  wrote:
>>
>>> DataStax bulk loaded can be an option if data is large.
>>>
>>> On Fri, Jan 17, 2020, 07:33 Nitan Kainth  wrote:
>>>
 If the keyspace already exist, use copy command or sstableloader to
 merge data. If data volume it too big, consider spark or a custom java
 program


 Regards,

 Nitan

 Cell: 510 449 9629

 On Jan 16, 2020, at 10:26 PM, Ankit Gadhiya 
 wrote:

 
 Any leads on this ?

 — Ankit

 On Thu, Jan 16, 2020 at 8:51 PM Ankit Gadhiya 
 wrote:

> Hi Arvinder,
>
> Thanks for your response.
>
> Yes - Cluster B already has some data. Tables/KS names are identical ;
> for data - I still haven't got the clarity if it has identical data or no 
> -
> I am assuming no since it's for different customers but need the
> confirmation.
>
> *Thanks & Regards,*
> *Ankit Gadhiya*
>
>
>
> On Thu, Jan 16, 2020 at 8:49 PM Arvinder Dhillon <
> dhillona...@gmail.com> wrote:
>
>> So as I understand, Cluster B already has some data and not an empty
>> cluster.
>>
>> When you say, clusters share same keyspace and table names, do you
>> mean both clusters have identical data on those ks/tables?
>>
>>
>> -Arvi
>>
>> On Thu, Jan 16, 2020, 5:27 PM Ankit Gadhiya 
>> wrote:
>>
>>> Hello Group,
>>>
>>> I have a requirement in one of the production systems where I need
>>> to be able to migrate entire dataset from Cluster A (Azure Region A) to
>>> Cluster B (Azure Region B).
>>>
>>> Each cluster have 3 Cassandra nodes (RF=3) running used by different
>>> applications. Few of the applications are common is Cluster A and 
>>> Cluster B
>>> thereby sharing same keyspace/table names.
>>> Need suggestion for the best possible migration strategy here
>>> considering - 1. No Application code changes possible - Minor 
>>> config/infra
>>> changes can be considered. 2. Zero data loss. 3. No/Minimal downtime.
>>>
>>> It'd be great to hear ideas from all of you based on your
>>> experiences.
>>>
>>> Cassandra Version - Cassandra 3.0.13 on both sides.
>>> Total Data size - Cluster A: 70 GB, Cluster B: 15 GB
>>>
>>> *Thanks & Regards,*
>>> *Ankit Gadhiya*
>>>
>>> --
 *Thanks & Regards,*
 *Ankit Gadhiya*

 --
> *Thanks & Regards,*
> *Ankit Gadhiya*
>
>


Re: Cassandra LWT Writes inconsistent

2019-07-09 Thread Upasana Sharma
Thanks Hiro & Jeff

Jeff,

My LWT(Insert if not exists) query is executed in parallel by 6 threads,
with a possibility of collision.
So, all threads may request to write same data on Cassandra tables.

What would you suggest here ?



Hiro,
i am using Datastax Mapper & Accessor for this.
Something similar to this :
https://docs.datastax.com/en/developer/java-driver/3.6/manual/object_mapper/creating/

Do you have a suggestion , how can i verify that my code is actually
setting query consistency?


Thank you for your response.


On Tue, Jul 9, 2019 at 5:30 PM Hiroyuki Yamada  wrote:

> Do you also set SERIAL CONSISTENCY properly ?
>
> https://docs.datastax.com/en/archived/cql/3.3/cql/cql_reference/cqlshSerialConsistency.html
>
> Hiro
>
> On Tue, Jul 9, 2019 at 2:25 PM Jeff Jirsa  wrote:
> >
> > If applied is false it’s not the first write, the value already exists.
> You’ve likely got a concurrency issue app side or you don’t understand the
> concurrent queries you’re issuing to the db
> >
> > On Jul 8, 2019, at 10:08 PM, raman gugnani 
> wrote:
> >
> > Hi Team,
> >
> > Can anyone help on the same.
> >
> > Cassnadra driver says write is not done but eventually write has been
> done.
> >
> > On Mon, 8 Jul 2019 at 12:31, Upasana Sharma <028upasana...@gmail.com>
> wrote:
> >>
> >>
> >> Hi,
> >>
> >> I am using an LWT Insert transaction similar to:
> >>
> >> INSERT INTO table1 (code, id, subpart) VALUES (:code, :id, :subpart) IF
> NOT EXISTS
> >>
> >> With
> >> readConsistency="LOCAL_SERIAL"
> >> writeConsistency="LOCAL_QUORUM"
> >>
> >> Cassandra Driver: 3.6.0
> >> Cassandra Version: Cassandra 3.11.2
> >>
> >>
> >> The problem is that I am getting [applied] false on the first write to
> cassandra.
> >>
> >> I have set retry policy as writeTimes = 0, so no retries are attempted.
> >>
> >> My application logs for reference:
> >>
> >> c-7967981443032352 - [INFO ] 2019-06-18T19:46:16.276Z
> [pool-15-thread-5] CreateService - SubPartition 104
> >> c-7967981443032352 - [INFO ] 2019-06-18T19:46:16.805Z
> [pool-15-thread-5] Repository - Row[false, A, 1, 104]
> >> c-7967981443032352 - [INFO ] 2019-06-18T19:46:16.805Z
> [pool-15-thread-5] CreateService - SubPartition 104 CodeNumber 75191
> DuplicateCodeGenerated A
> >>
> >> This is causing my count of writes to tables to differ from required
> 10, to 11, writing extra codes.
> >>
> >> Please guide here.
> >>
> >> --
> >> Regards,
> >> Upasana Sharma
> >
> >
> >
> > --
> > Raman Gugnani
> >
> > 8588892293
> > Principal Engineer
> > ixigo.com
>
> -
> To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org
> For additional commands, e-mail: user-h...@cassandra.apache.org
>
>

-- 
Regards,
Upasana Sharma


Cassandra LWT Writes inconsistent

2019-07-08 Thread Upasana Sharma
Hi,

I am using an LWT Insert transaction similar to:

INSERT INTO table1 (code, id, subpart) VALUES (:code, :id, :subpart) IF NOT
EXISTS

With
readConsistency="LOCAL_SERIAL"
writeConsistency="LOCAL_QUORUM"

Cassandra Driver: 3.6.0
Cassandra Version: Cassandra 3.11.2


The problem is that I am getting* [applied] false* on the *first write* to
cassandra.

I have set retry policy as writeTimes = 0, so no retries are attempted.

My application logs for reference:

c-7967981443032352 - [INFO ] 2019-06-18T19:46:16.276Z [pool-15-thread-5]
CreateService - SubPartition 104
c-7967981443032352 - [INFO ] 2019-06-18T19:46:16.805Z
[pool-15-thread-5] *Repository
- Row[false, A, 1, 104]*
c-7967981443032352 - [INFO ] 2019-06-18T19:46:16.805Z [pool-15-thread-5]
CreateService - SubPartition 104 CodeNumber 75191
*DuplicateCodeGenerated A*

This is causing my count of writes to tables to differ from required
10, to 11, writing extra codes.

Please guide here.

-- 
Regards,
Upasana Sharma