GithubHelp home page GithubHelp logo

Comments (4)

slivne avatar slivne commented on May 14, 2024

We do not support it at this point - doing range_queries in read in cluster - closing

from scylladb.

gleb-cloudius avatar gleb-cloudius commented on May 14, 2024

On Wed, Jul 15, 2015 at 09:31:05AM -0700, slivne wrote:

We do not support it at this point - doing range_queries in read in cluster - closing

The crash has nothing to do with range_queries read in cluster though.
It crashes in deserializer because it uses assign operator instead of
placement new. This patch should fix the crash:

diff --git a/mutation_query.cc b/mutation_query.cc
index 50b6f27..539dd1e 100644
--- a/mutation_query.cc
+++ b/mutation_query.cc
@@ -87,7 +87,7 @@ void db::serializer<reconcilable_result>::read(reconcilable_result& v, input& in
auto fm = db::frozen_mutation_serializer::read(in);
partitions.emplace_back(partition(p_row_count, std::move(fm)));
}

  • v = reconcilable_result(row_count, std::move(partitions));
  • new (&v) reconcilable_result(row_count, std::move(partitions));
    }

future<reconcilable_result>

    Gleb.

from scylladb.

tgrabiec avatar tgrabiec commented on May 14, 2024

2015-07-15 18:49 GMT+02:00 Gleb Natapov [email protected]:

On Wed, Jul 15, 2015 at 09:31:05AM -0700, slivne wrote:

We do not support it at this point - doing range_queries in read in
cluster - closing

The crash has nothing to do with range_queries read in cluster though.
It crashes in deserializer because it uses assign operator instead of
placement new. This patch should fix the crash:

diff --git a/mutation_query.cc b/mutation_query.cc
index 50b6f27..539dd1e 100644
--- a/mutation_query.cc
+++ b/mutation_query.cc
@@ -87,7 +87,7 @@ void
db::serializer<reconcilable_result>::read(reconcilable_result& v, input& in
auto fm = db::frozen_mutation_serializer::read(in);
partitions.emplace_back(partition(p_row_count, std::move(fm)));
}

  • v = reconcilable_result(row_count, std::move(partitions));
  • new (&v) reconcilable_result(row_count, std::move(partitions));

The output of db::serializer::read() is not said to be uninitialized,
there's this for example:

template<>
void db::serializer::read(sstring& s, input& in) {
s = in.read();
}

The fix could be in net::serializer::read_serializable(), but it assumes
that values are movable:

diff --git a/message/messaging_service.hh b/message/messaging_service.hh
index 2a3033d..897969b 100644
--- a/message/messaging_service.hh
+++ b/message/messaging_service.hh
@@ -136,7 +136,7 @@ struct serializer {
}
bytes_view bv(reinterpret_cast<const int8_t*>(buf.get()),
sz);
data_input in(bv);

  •            db::serializer<Serializable>::read(v, in);
    
  •            new (&v) (db::serializer<Serializable>::read(in));
         });
     });
    
    }

Or we could align db::serializer<>::read() so that they're like rpc
deserializers wrt to output parameter.

from scylladb.

gleb-cloudius avatar gleb-cloudius commented on May 14, 2024

On Wed, Jul 15, 2015 at 10:09:07AM -0700, Tomasz Grabiec wrote:

2015-07-15 18:49 GMT+02:00 Gleb Natapov [email protected]:

On Wed, Jul 15, 2015 at 09:31:05AM -0700, slivne wrote:

We do not support it at this point - doing range_queries in read in
cluster - closing

The crash has nothing to do with range_queries read in cluster though.
It crashes in deserializer because it uses assign operator instead of
placement new. This patch should fix the crash:

diff --git a/mutation_query.cc b/mutation_query.cc
index 50b6f27..539dd1e 100644
--- a/mutation_query.cc
+++ b/mutation_query.cc
@@ -87,7 +87,7 @@ void
db::serializer<reconcilable_result>::read(reconcilable_result& v, input& in
auto fm = db::frozen_mutation_serializer::read(in);
partitions.emplace_back(partition(p_row_count, std::move(fm)));
}

  • v = reconcilable_result(row_count, std::move(partitions));
  • new (&v) reconcilable_result(row_count, std::move(partitions));

The output of db::serializer::read() is not said to be uninitialized,
there's this for example:

template<>
void db::serializer::read(sstring& s, input& in) {
s = in.read();
}

The fix could be in net::serializer::read_serializable(), but it assumes
that values are movable:

diff --git a/message/messaging_service.hh b/message/messaging_service.hh
index 2a3033d..897969b 100644
--- a/message/messaging_service.hh
+++ b/message/messaging_service.hh
@@ -136,7 +136,7 @@ struct serializer {
}
bytes_view bv(reinterpret_cast<const int8_t*>(buf.get()),
sz);
data_input in(bv);

  •            db::serializer<Serializable>::read(v, in);
    
  •            new (&v) (db::serializer<Serializable>::read(in));
         });
     });
    
    }

Or we could align db::serializer<>::read() so that they're like rpc
deserializers wrt to output parameter.

I think your fix is good. Serializable class should be easily movable.

        Gleb.

from scylladb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.