New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15721] Peloton Self-Driving Infrastructure #1346

Open
wants to merge 132 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@ChTimTsubasa
Member

ChTimTsubasa commented May 5, 2018

This PR is working toward an infrastructure for self-driving components on Peloton.

In this checkpoint, we presented:

  1. A brand new framework for stats collections.
    2, Based on the new framework we collected
    1. query metrics measuring latency for queries.
    2. table metrics measuring operations count on a specific table, memory usage and memory allocation for both inline data and varlen data
    3. index metrics measuring operations count on a specific index, estimated memory usage and memory allocation stats.

To do:
Update metrics on catalog

@swimj

This comment has been minimized.

Collaborator

swimj commented on 072e953 Apr 10, 2018

-- did sanity check by printing out latencies: for identical traces of SQL queries, the latencies drop when Timer start/stop is moved into plan_executor as opposed to txn_manager

-- side benefit is that latency of internal transactions (such as those generated by stats aggregation thread) is not recorded, since those don't go through plan_executor. I think this is what we want?

Tianyi Chen and others added some commits Apr 10, 2018

Begin potential abstract_metric refactor
AbstractMetric just exists for GetInfo()/Reset().

PointMetric is an abstraction for counter-like metrics
which get incremented/decremented at a specific point of execution.

IntervalMetric is an abstraction for timer-based metrics
whose measurements occur over some duration of execution.
Begin potential abstract_metric refactor
AbstractMetric just exists for GetInfo()/Reset().

PointMetric is an abstraction for counter-like metrics
which get incremented/decremented at a specific point of execution.

IntervalMetric is an abstraction for timer-based metrics
whose measurements occur over some duration of execution.
Merge branch '721-Proj3' of https://github.com/ChTimTsubasa/peloton i…
…nto 721-Proj3

Conflicts:
	src/include/statistics/point_metric.h

Tianyi Chen added some commits May 12, 2018

@ChTimTsubasa

This comment has been minimized.

Member

ChTimTsubasa commented May 12, 2018

This is not going to add much overhead to the engine as the collector would not be blocked. Actually, the blocking thing is the background aggregating thread as it is CAS on the safe_ flag.

We would like the test the overhead with some TPCC testbench but it seems that the master branch is running slow. We would definitely run TPCC if we get fast enough later, and we claim it's not going to be hard (just change the stats_mode would switch the collection from on/off).

@ChTimTsubasa

This comment has been minimized.

Member

ChTimTsubasa commented May 12, 2018

Test cases for the framework are added in stats_framework_test.cpp

@@ -33,6 +32,7 @@
#include "function/timestamp_functions.h"
#include "index/index_factory.h"
#include "settings/settings_manager.h"
#include "storage/database.h"

This comment has been minimized.

@sivaprasadsudhir

sivaprasadsudhir May 13, 2018

Member

In line 198 of this file, the flag should be brain_data_collection. Probably the reason why query_logger_test is failing.

This comment has been minimized.

@ChTimTsubasa

ChTimTsubasa May 13, 2018

Member

Change it. Still failing the test. The log is

174: 2018-05-13 10:48:16 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:16 [src/codegen/operator/table_scan_translator.cpp:40:TableScanTranslator] DEBUG - Constructing TableScanTranslator ...
174: 2018-05-13 10:48:16 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: 2018-05-13 10:48:21 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:21 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: 2018-05-13 10:48:26 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:26 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: 2018-05-13 10:48:31 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:31 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: 2018-05-13 10:48:36 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:36 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: 2018-05-13 10:48:41 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:41 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: /home/tianyi/Documents/project/peloton/test/sql/testing_sql_util.cpp:274: Failure
174: Value of: actual_result.size()
174: Actual: 10
174: Expected: ref_result.size()
174: Which is: 11
174: /home/tianyi/Documents/project/peloton/test/sql/testing_sql_util.cpp:282: Failure
174: Value of: actual_result
174: Actual: { "CREATE TABLE test(a INT);|015a5c39f1d456672ab662e8bf9d13598d5d87f697", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (2);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "BEGIN;|011e0b3628080f24ada46945aaaa12f4ae69ed0a3b", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "COMMIT;|01cf0fba0f1cfd731e80292bd9c5e92abbec9056d1" }
174: Expected: ref_result
174: Which is: { "CREATE TABLE test(a INT);|015a5c39f1d456672ab662e8bf9d13598d5d87f697", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (2);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "BEGIN;|011e0b3628080f24ada46945aaaa12f4ae69ed0a3b", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "COMMIT;|01cf0fba0f1cfd731e80292bd9c5e92abbec9056d1" }
174: 2018-05-13 10:48:46 [test/sql/testing_sql_util.cpp:60:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;
174: 2018-05-13 10:48:46 [test/sql/testing_sql_util.cpp:95:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS
174: /home/tianyi/Documents/project/peloton/test/sql/testing_sql_util.cpp:274: Failure
174: Value of: actual_result.size()
174: Actual: 12
174: Expected: ref_result.size()
174: Which is: 13
174: /home/tianyi/Documents/project/peloton/test/sql/testing_sql_util.cpp:282: Failure
174: Value of: actual_result
174: Actual: { "CREATE TABLE test(a INT);|015a5c39f1d456672ab662e8bf9d13598d5d87f697", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (2);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "BEGIN;|011e0b3628080f24ada46945aaaa12f4ae69ed0a3b", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "COMMIT;|01cf0fba0f1cfd731e80292bd9c5e92abbec9056d1", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914" }
174: Expected: ref_result
174: Which is: { "CREATE TABLE test(a INT);|015a5c39f1d456672ab662e8bf9d13598d5d87f697", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (2);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "BEGIN;|011e0b3628080f24ada46945aaaa12f4ae69ed0a3b", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "INSERT INTO test VALUES (1);|01494aa495a99247b2fe92808c6ae2df065e2ec101", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "COMMIT;|01cf0fba0f1cfd731e80292bd9c5e92abbec9056d1", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914", "SELECT query_string, fingerprint FROM peloton.pg_catalog.pg_query_history;|01851b97a4b7d3bc7fefc53d3b920878c08c4cc914" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment