Skip to content

Commit

Permalink
update comit and sysbench urn
Browse files Browse the repository at this point in the history
  • Loading branch information
BilyZ98 committed Aug 21, 2022
1 parent 4c09bcb commit 9dbc86f
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 8 deletions.
1 change: 1 addition & 0 deletions install_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13851,6 +13851,7 @@
/usr/local/mysql/mysql-test/./collections/disabled-weekly.list
/usr/local/mysql/mysql-test/./collections/README
/usr/local/mysql/mysql-test/./collections/default.weekly.basic
/usr/local/mysql/mysql-test/./var
/usr/local/mysql/mysql-test/./mysql-test-run.pl
/usr/local/mysql/mysql-test/./README
/usr/local/mysql/mysql-test/mtr
Expand Down
8 changes: 4 additions & 4 deletions sql/mysql_githash.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
#pragma once

#define MYSQL_GIT_HASH "0248ea40bcd71904b4fa81b5ae745623cb5e0111"
#define MYSQL_GIT_DATE "2022-08-17T11:39:23+08:00"
#define MYSQL_GIT_HASH "4c09bcb3503969ebdb1402bc9e890d1dd80ae8d8"
#define MYSQL_GIT_DATE "2022-08-17T23:12:20+08:00"

#define ROCKSDB_GIT_HASH "f3d0ae60ac0ccac9b41b7abf2e9214cf3dbd0e40"
#define ROCKSDB_GIT_DATE "2022-08-16T20:46:16+08:00"
#define ROCKSDB_GIT_HASH "0d724da14e557379ca531fd362e4dbdf1749e9bd"
#define ROCKSDB_GIT_DATE "2022-08-18T00:01:59+08:00"
1 change: 1 addition & 0 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6390,6 +6390,7 @@ static int rocksdb_done_func(void *const p) {

delete rdb;
rdb = nullptr;
sql_print_information("Rocksdb: DB instance closed");

delete commit_latency_stats;
commit_latency_stats = nullptr;
Expand Down
43 changes: 43 additions & 0 deletions trace_docs/diary/8-19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Something weird,


I found out that there is no db end tracing log .


There is 'end tracing ' initial install phase.
The rocksdb instance is shutdown gracefully .

How can I run a graceful shutdown.



- Gracefully shutdown a process
https://stackoverflow.com/questions/690415/in-what-order-should-i-send-signals-to-gracefully-shutdown-processes

`kill -15 $pid`

Now there is end tracing log in the LOG

I need to check the startTrace code to see if the new trace file will overwrite the existing one.

But there is still error while parsing op trace file.


I check the `env/fs_posix.cc`
The file will be truncated.


## Fix a bug which I don't know why

- Bug description
When I run `trace_analyzer` to parse the op_trace_file, the
`Iterate()` function in `write_batch.cc` reports error while executing
`MarkNoop()` function, the handler does not over write the `MarkNoop()`
function from `Handler`, so it calls methods from parents which returns
invalid status, thus causing a error.


- My fix
I just add the `MarkNoop()` override function in the `Classifier` Handler.


54 changes: 54 additions & 0 deletions trace_docs/diary/8-20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@



# Table format
op_human_readable_trace

[type_id cf_id value_size time_in_micorsec <key>]

[key, type_id, cf_id, value_size , time in microsec]

Let's just plot something here.

using 5:4



- block cache human file

Access timestamp: 1
Block ID: 2
Level: 7
SST file number: 8
Cache hit : 14



- io_trace_res

time_stamp : 1
file_op : 2
latency : 3
io status : 4
file name : 5





















56 changes: 56 additions & 0 deletions trace_docs/diary/8-21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@


I think I found a bug ?

The timestamp in io trace file does not make sense
record timestamp:100853315672962


start timstamp: 1661002238043735

time I get with the bash command `date +%s%N`
1661073847698401833

Turns out that record timestamp is return by NowNanos()
And start timestamp is return by NowMicros();

I don't know why the it is, I think it's a bug.

So I will just submit a pr, fix this.


How linux get nano time
```
uint64_t NowNanos() override {
#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_GNU_KFREEBSD) || \
defined(OS_AIX)
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return static_cast<uint64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec;
#elif defined(OS_SOLARIS)
```



Check the source code and run a test by myself,

Found that it's because there is subttle difference.

```
# define CLOCK_REALTIME 0
/* Monotonic system-wide clock. */
# define CLOCK_MONOTONIC 1
/*
```


```
uint64_t NowNanos() {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
printf("seconds: %lu\n", static_cast<uint64_t>(ts.tv_sec));
return (static_cast<uint64_t>(ts.tv_sec) * 1000000000) + ts.tv_nsec;
}
```
4 changes: 2 additions & 2 deletions trace_test/load.pl
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ sub generate_load_sqls {
}
# $load_output = `mysql -u root -e "SET session rocksdb_bulk_load=1; use test; LOAD DATA LOCAL INFILE '~/tpc-h/TPC-H_Tools_v3.0.0/dbgen/lineitem.tbl' INTO TABLE lineitem FIELDS TERMINATED BY '|';"`;

$alter_res = `mysql -u root test < tpch_mysql_schema_alter.sql`;
print "aterl result is $alter_res\n";
# $alter_res = `mysql -u root test < tpch_mysql_schema_alter.sql`;
# print "aterl result is $alter_res\n";

$line_count = `mysql -u root -e "use test; select count(*) from LINEITEM;"`;

Expand Down
32 changes: 32 additions & 0 deletions trace_test/run_sysbench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

sysbench_dir="/home/bily/sysbench/sysbench/src/lua"

./install.pl


./start_server.pl

pushd $sysbench_dir

sleep 3


sysbench ./oltp_read_write.lua --mysql-port=3306 \
--mysql-user=root --mysql-db=test \
--tables=4 --table_size=1000000 \
--mysql_storage_engine=rocksdb \
--mysql-socket=/tmp/mysql.sock \
--threads=64 prepare


sysbench ./oltp_read_write.lua --mysql-port=3306 \
--mysql-user=root --mysql-db=test \
--tables=4 --table_size=1000000 \
--mysql_storage_engine=rocksdb \
--mysql-socket=/tmp/mysql.sock \
--report-interval=3 \
--time=60 \
--threads=64 run
popd

./shut_server.pl
2 changes: 1 addition & 1 deletion trace_test/shut_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
chomp($pid);


kill 9,$pid;
kill 15,$pid;


0 comments on commit 9dbc86f

Please sign in to comment.