* Sairam M P <smart...@gmail.com> [16/02/23 10:37]:
> tarantool> box.space._cluster:select{}
> ---
> - - [1, 'd6338d72-7808-47f6-8961-5fbd27a43950']
> - [2, 'dba55807-cb01-4a6a-88a9-b09c4d6537e9']
> - [3, '7be545b8-b4fb-41e4-b1da-4c64fb9891df']
> ...
>
> I am trying to break the replication between *Slave -> Sec.Slave* and
> reconfigure it as *Master -> Sec.Slave.*
>The _cluster table does not store configuration, which is dynamic,
it stored the persistent content. Perhaps it sounds confusing,
but please try to think about this way: once a node has joined
a cluster, we assume it never goes away forever, without a DBA
explicit action (delete the node from _cluster), but may flicker
on and off depending on the actual cluster configuration.
Actually the master output doesn't contains the second slave's uuid. Is this the cause of error ? What can be the reason for the master not having the second slave's uuid.
-Sairam.
Consider I have a setup like Master -> Slave -> Sec. Slave, when a write happens at master I hope the wal files at master, slave, sec. slave all will contain the same server I'd and Lsn that originated from master. Is my understanding right !?
If so there should not be an issue in reconfiguring replication from master -> sec. slave in the above setup right !?
-Sairam.
Please throw some lights on the internals of tarantool replication and its failover.
-Sairam.
* Sairam M P <smart...@gmail.com> [16/02/18 20:04]:
> The below is after is restarted both master & slave and reconfigure the
> replication. Seems the lag is 0 now and i am able to select the tuples. But
> when i tried the first time there a was like -4.0....
It could be the case, yes, if the server can't establish a
replication link it doesn't abort - only writes an error in the
log file.
> Konstantin some basic question :
>
> Is there a way i can start tarantool other than interactive mode ? like in
> background.. Only & can be used or is it by someother means ?
Put the commands you write in the interactive mode into a .lua
file, add #!/usr/bin/env tarantool as the first line of the file,
change permissions to be able to execute the script and run the
script.
If you need the server to daemonize after start, add
background=true to the list of box.cfg{} options.
Better yet, put this script to
/etc/tarantool/instances.enabled and use tarantoolctl start
<instancename>
try {
TarantoolConnection16 con;
byte[] buf = "156457".getBytes();
con = new TarantoolConnection16Impl("x.x.x.x", 3301);
con.insert(513, Arrays.asList("dummykey",buf));
out.println(((ArrayList)(con.select(513, 0, Arrays.asList("dummykey"), 0,100,0).get(0))).get(1).getClass());//expecting byte[] getting String
}catch(Exception e) {
out.println(e.getMessage());
}
-Sairam.
--
You received this message because you are subscribed to a topic in the Google Groups "Tarantool discussion group (English)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tarantool/ZtL6fI7TZ0M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tarantool+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes we are using Java driver.Here is the snippet :
try {
TarantoolConnection16 con;
byte[] buf = "156457".getBytes();
con = new TarantoolConnection16Impl("x.x.x.x", 3301);
con.insert(513, Arrays.asList("dummykey",buf));
out.println(((ArrayList)(con.select(513, 0, Arrays.asList("dummykey"), 0,100,0).get(0))).get(1).getClass());//expecting byte[] getting String
}catch(Exception e) {
out.println(e.getMessage());
}
-Sairam.
On Friday, March 11, 2016, Konstantin Osipov <> wrote:* Sairam M P <> [16/03/10 21:07]:
> We were trying to dump our data to tarantool and get the same from
> tarantool. Our data is in byte array format, we were able to insert the
> byte array data to tarantool and the data is appended as binary in the
> tarantool db. However when we try to fetch this data through *select*
> method we are only able to get this data as string and not as byte array.
> Kindly let me know on how to select the binary data from tarantool as
> byte[].
Are you using the Java driver?
Do you have an example program in Java I could comment on?
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.org - www.twitter.com/kostja_osipov
--
You received this message because you are subscribed to a topic in the Google Groups "Tarantool discussion group (English)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tarantool/ZtL6fI7TZ0M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tarantool+unsubscribe@googlegroups.com.
Note
box.space.space-name.index.index-name:select(...)[1]`. can be replaced by box.space.space-name.index.index-name:get(...). That is, get can be used as a convenient shorthand to get the first tuple in the tuple set that would be returned by select. However, if there is more than one tuple in the tuple set, then get returns an error.
--
You received this message because you are subscribed to a topic in the Google Groups "Tarantool discussion group (English)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tarantool/ZtL6fI7TZ0M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tarantool+...@googlegroups.com.
Hi, you should create field like msgPackOptions in your ConState and set required value for each query you made.Schema method requires OPTION_UNPACK_RAW_AS_STRING. So you should set OPTION_UNPACK_RAW_AS_BYTE_BUFFER only for queries which requires ByteBuffer or you should set options to zero for queries requires byte[].
пятница, 11 марта 2016 г., 17:35:14 UTC+3 пользователь Sairam M P написал:Hi Dmitry,
Thanks a lot for the response.
We tried the following changes, but we are encountering null pointer exception in schema initializations.java.lang.NullPointerException at org.tarantool.TarantoolConnection16Base.schema(TarantoolConnection16Base.java:182)Our code snippet for the below changes :The main class :TarantoolConnection16 con = new TarantoolConnection16Impl("x.x.x.x", 3301);Field f = TarantoolConnection16Base.class.getDeclaredField("state");f.setAccessible(true);f.set(con, new ConState());final KeyValueSchema schema = new KeyValueSchema();con.schema(schema); // -----------------Getting null pointer here.---------------------------The inner class :private static class ConState extends ConnectionState {@Overridepublic void unpack() {ByteBuffer buf = buffer.getBuf();buf.limit(buf.position());buf.rewind();body.clear();header.clear();try {toKeyMap(MsgPackLite.unpack(buffer.asInputStream(), MsgPackLite.OPTION_UNPACK_RAW_AS_STRING), header); // Do we need to change in header also ? But even changing here to BYTE_BUFFER doesn't works. Getting same null pointer exception.if (buf.remaining() > 0) {toKeyMap(MsgPackLite.unpack(buffer.asInputStream(), MsgPackLite.OPTION_UNPACK_RAW_AS_BYTE_BUFFER), body); //Changes done.}} catch (IOException e) {// this shouldn't happensthrow new IllegalStateException(e);}}private void toKeyMap(Object unpack, EnumMap<Key, Object> result) {Map<Integer, Object> map = (Map<Integer, Object>) unpack;for (Map.Entry<Integer, Object> entry : map.entrySet()) {Key key = Key.getById(entry.getKey());if (key != null) {result.put(key, entry.getValue());}}}}Kindly help us in resolving the above one.-Sairam.
On Friday, March 11, 2016 at 4:12:35 PM UTC+5:30, Dmitry Grytsovets wrote:This happens due to MsgPackLite.OPTION_UNPACK_RAW_AS_STRING.I will give ability to set this options in the next driver release.At this moment I could advice workaround:Override ConnectionState upack method topublic void unpack() {...toKeyMap(MsgPackLite.unpack(buffer.asInputStream(), 0), body);...}then change TarantoolConnection16Impl state to overriden one immediatly after construction.
четверг, 10 марта 2016 г., 22:17:11 UTC+3 пользователь Sairam M P написал:Yes we are using Java driver.Here is the snippet :try {
TarantoolConnection16 con;
byte[] buf = "156457".getBytes();
con = new TarantoolConnection16Impl("x.x.x.x", 3301);
con.insert(513, Arrays.asList("dummykey",buf));
out.println(((ArrayList)(con.select(513, 0, Arrays.asList("dummykey"), 0,100,0).get(0))).get(1).getClass());//expecting byte[] getting String
}catch(Exception e) {
out.println(e.getMessage());
}
-Sairam.
On Friday, March 11, 2016, Konstantin Osipov <> wrote:
* Sairam M P <> [16/03/10 21:07]:
> We were trying to dump our data to tarantool and get the same from
> tarantool. Our data is in byte array format, we were able to insert the
> byte array data to tarantool and the data is appended as binary in the
> tarantool db. However when we try to fetch this data through *select*
> method we are only able to get this data as string and not as byte array.
> Kindly let me know on how to select the binary data from tarantool as
> byte[].
Are you using the Java driver?
Do you have an example program in Java I could comment on?
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.org - www.twitter.com/kostja_osipov
--
You received this message because you are subscribed to a topic in the Google Groups "Tarantool discussion group (English)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tarantool/ZtL6fI7TZ0M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tarantool+unsubscribe@googlegroups.com.