Git Product home page Git Product logo

Comments (4)

denesb avatar denesb commented on June 14, 2024

Yes, this is an issue that is known for a long time, there is a duplicate issue somewhere, but I will probably fail to find it.

This error is raised in a place where all this context is missing. The CQL query is not even available on the node where this happens (this happens on the replica). So this is not a simple as just amending the error message.

from scylladb.

bhalevy avatar bhalevy commented on June 14, 2024

something like this:

diff --git a/query-result-set.cc b/query-result-set.cc
index 9e956d40c4..672fdcce66 100644
--- a/query-result-set.cc
+++ b/query-result-set.cc
@@ -62,7 +62,7 @@ std::ostream& operator<<(std::ostream& out, const result_set& rs) {
     return out;
 }
 
-static logging::logger query_result_log("query_result_log");
+logging::logger query_result_log("query_result_log");
 
 non_null_data_value::non_null_data_value(data_value&& v) : _v(std::move(v)) {
     if (_v.is_null()) {
diff --git a/query-result.hh b/query-result.hh
index b97e5a6c58..e651cfa035 100644
--- a/query-result.hh
+++ b/query-result.hh
@@ -19,6 +19,8 @@
 
 namespace query {
 
+extern logging::logger query_result_log;
+
 struct short_read_tag { };
 using short_read = bool_class<short_read_tag>;
 
@@ -195,6 +197,8 @@ class result_memory_accounter {
             _blocked_bytes += to_block;
             stop = (_limiter->update_and_check(to_block) && _stop_on_global_limit) || stop;
             if (stop && !_short_read_allowed) {
+                query_result_log.error("Memory exhausted for unpaged query: n={} used={} to_block={} stop_on_local_limit={} stop_on_global_limit={}",
+                        n, _used_memory, to_block, bool(check_local_limit()), bool(_limiter->update_and_check(to_block)));
                 // If we are here we stopped because of the global limit.
                 throw std::runtime_error("Maximum amount of memory for building query results is exhausted, unpaged query cannot be finished");
             }
diff --git a/service/storage_service.cc b/service/storage_service.cc
index 110e6701d2..0a8d7b157f 100644
--- a/service/storage_service.cc
+++ b/service/storage_service.cc
@@ -6394,6 +6394,7 @@ future<join_node_response_result> storage_service::join_node_response_handler(jo
 }
 
 std::vector<canonical_mutation> storage_service::get_system_mutations_in_thread(schema_ptr schema) {
+  try {
     std::vector<canonical_mutation> result;
     auto rs = db::system_keyspace::query_mutations(_db, schema).get();
     result.reserve(rs->partitions().size());
@@ -6401,6 +6402,10 @@ std::vector<canonical_mutation> storage_service::get_system_mutations_in_thread(
         result.emplace_back(make_canonical_mutation_in_thread(p.mut().unfreeze_gently(schema).get()));
     }
     return result;
+  } catch (...) {
+    slogger.error("get_system_mutations_in_thread {}.{} failed: {}", schema->ks_name(), schema->cf_name(), std::current_exception());
+    throw;
+  }
 }
 
 node_state storage_service::get_node_state(locator::host_id id) {

from scylladb.

denesb avatar denesb commented on June 14, 2024

This would cover some subset of internal queries, but not the other and not the user queries.

from scylladb.

bhalevy avatar bhalevy commented on June 14, 2024

This would cover some subset of internal queries, but not the other and not the user queries.

Peobablu. It was tailored for #17573

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.