Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org,
	Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [tarantool-patches] Re: [PATCH v3 4/7] lib: update msgpuck library
Date: Fri, 5 Apr 2019 20:17:25 +0300	[thread overview]
Message-ID: <58a0a5ad-1293-eb8f-704b-88e7ef1961e4@tarantool.org> (raw)
In-Reply-To: <20190404155433.6abpuiwakrxjyktg@esperanza>

> Other than that, the patch looks good, BUT for some reason it doesn't
> compile on CentOS 6 on Travis, see
> 
>   https://travis-ci.org/tarantool/msgpuck/jobs/515314874
> 
> It fails with
> 
>   BFD: /build/BUILDROOT/msgpuck-2.0.23-1.el6.x86_64/usr/lib64/libmsgpuck.a(msgpuck.c.o): invalid relocation type 42
> 
> Please figure out why is that and fix if possible.

> Once you figure out why msgpuck build failed on Travis (see my other
> email), please rebase this patch on top of the master branch so that
> we can push it right away.
Unfortunately, I don't know what's wrong here.

This problem is reproduced even on empty branch(master duplicate)
https://travis-ci.org/tarantool/msgpuck/builds/516062909?utm_source=github_status&utm_medium=notification
Seems something wrong with el6. I've googled that this connected with -fPIC.

> Can we please refactor it a little so that we don't call mp_stack_top
> twice in case the frame is advanced?

Nice. Tnx!

============================================================

The msgpack dependency has been updated because the new version
introduces the new method mp_stack_top for the mp_stack class
which we will use to store a pointer for a multikey frame to
initialize a field_map in case of multikey index.

As the library API has changed, the code has been modified
correspondingly.

Needed for #1012
---
 src/box/tuple_format.c | 9 +++++----
 src/box/vy_stmt.c      | 8 ++++----
 src/lib/msgpuck        | 2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c
index 1043707ad..093046b37 100644
--- a/src/box/tuple_format.c
+++ b/src/box/tuple_format.c
@@ -850,8 +850,8 @@ tuple_field_map_create(struct tuple_format *format, const char *tuple,
 	struct tuple_field *field;
 	struct json_token *parent = &format->fields.root;
 	while (true) {
-		int idx;
-		while ((idx = mp_stack_advance(&stack)) == -1) {
+		struct mp_frame *frame = mp_stack_top(&stack);
+		while (!mp_frame_advance(frame)) {
 			/*
 			 * If the elements of the current frame
 			 * are over, pop this frame out of stack
@@ -863,6 +863,7 @@ tuple_field_map_create(struct tuple_format *format, const char *tuple,
 			mp_stack_pop(&stack);
 			if (mp_stack_is_empty(&stack))
 				goto finish;
+			frame = mp_stack_top(&stack);
 			parent = parent->parent;
 		}
 		/*
@@ -871,10 +872,10 @@ tuple_field_map_create(struct tuple_format *format, const char *tuple,
 		 * for the subsequent format::fields lookup.
 		 */
 		struct json_token token;
-		switch (mp_stack_type(&stack)) {
+		switch (frame->type) {
 		case MP_ARRAY:
 			token.type = JSON_TOKEN_NUM;
-			token.num = idx;
+			token.num = frame->idx;
 			break;
 		case MP_MAP:
 			if (mp_typeof(*pos) != MP_STR) {
diff --git a/src/box/vy_stmt.c b/src/box/vy_stmt.c
index 7387d72be..776b1f69c 100644
--- a/src/box/vy_stmt.c
+++ b/src/box/vy_stmt.c
@@ -447,18 +447,18 @@ vy_stmt_new_surrogate_delete_raw(struct tuple_format *format,
 	struct tuple_field *field;
 	struct json_token *parent = &format->fields.root;
 	while (true) {
-		int idx;
-		while ((idx = mp_stack_advance(&stack)) == -1) {
+		struct mp_frame *frame = mp_stack_top(&stack);
+		while (!mp_frame_advance(frame)) {
 			mp_stack_pop(&stack);
 			if (mp_stack_is_empty(&stack))
 				goto finish;
 			parent = parent->parent;
 		}
 		struct json_token token;
-		switch (mp_stack_type(&stack)) {
+		switch (frame->type) {
 		case MP_ARRAY:
 			token.type = JSON_TOKEN_NUM;
-			token.num = idx;
+			token.num = frame->idx;
 			break;
 		case MP_MAP:
 			if (mp_typeof(*src_pos) != MP_STR) {
diff --git a/src/lib/msgpuck b/src/lib/msgpuck
index 222b71aa6..9d04562fd 160000
--- a/src/lib/msgpuck
+++ b/src/lib/msgpuck
@@ -1 +1 @@
-Subproject commit 222b71aa63e8de6d0015588442d828460560d9be
+Subproject commit 9d04562fd898159f68b644ee11975210e15c6871
-- 
2.21.0

  reply	other threads:[~2019-04-05 17:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 15:49 [PATCH v3 0/7] box: introduce multikey indexes in memtx Kirill Shcherbatov
2019-04-02 15:49 ` [PATCH v3 1/7] box: cleanup key_def virtual extract_key setter Kirill Shcherbatov
2019-04-03 12:42   ` Vladimir Davydov
2019-04-03 16:22     ` [tarantool-patches] " Kirill Shcherbatov
2019-04-03 18:01       ` Vladimir Davydov
2019-04-02 15:49 ` [PATCH v3 2/7] lib: introduce a new json_path_multikey_offset helper Kirill Shcherbatov
2019-04-03 12:56   ` Vladimir Davydov
2019-04-03 16:22     ` [tarantool-patches] " Kirill Shcherbatov
2019-04-03 18:02       ` Vladimir Davydov
2019-04-04  6:17       ` Konstantin Osipov
2019-04-02 15:49 ` [PATCH v3 3/7] box: move offset_slot init to tuple_format_add_field Kirill Shcherbatov
2019-04-03 12:57   ` Vladimir Davydov
2019-04-03 18:02   ` Vladimir Davydov
2019-04-04  6:19   ` [tarantool-patches] " Konstantin Osipov
2019-04-05 17:17     ` [tarantool-patches] " Kirill Shcherbatov
2019-04-02 15:49 ` [PATCH v3 4/7] lib: update msgpuck library Kirill Shcherbatov
2019-04-03 17:49   ` [tarantool-patches] " Kirill Shcherbatov
2019-04-04 15:54     ` Vladimir Davydov
2019-04-05 17:17       ` Kirill Shcherbatov [this message]
2019-04-07 12:22         ` [tarantool-patches] " Vladimir Davydov
2019-04-02 15:49 ` [PATCH v3 5/7] box: introduce tuple_parse_iterator class Kirill Shcherbatov
2019-04-03 14:04   ` Vladimir Davydov
2019-04-05 17:17     ` [tarantool-patches] " Kirill Shcherbatov
2019-04-02 15:49 ` [PATCH v3 6/7] box: introduce field_map_builder class Kirill Shcherbatov
2019-04-03 14:38   ` Vladimir Davydov
2019-04-05 17:17     ` [tarantool-patches] " Kirill Shcherbatov
2019-04-03 16:30   ` Vladimir Davydov
2019-04-02 15:49 ` [PATCH v3 7/7] box: introduce multikey indexes in memtx Kirill Shcherbatov
2019-04-04 14:20   ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58a0a5ad-1293-eb8f-704b-88e7ef1961e4@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] Re: [PATCH v3 4/7] lib: update msgpuck library' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox