8000 Watt merge by itodnerd · Pull Request #20 · leanstore/leanstore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Watt merge #20

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

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open

Watt merge #20

wants to merge 46 commits into from

Conversation

itodnerd
Copy link
Contributor

Reimplemented WATT on Master

Additionally:

  • Rewrite Profiling Thread: Add Results table
  • Add "creator_threads" flag
  • Add Persist and Recover of values (non flag values)
  • ProbabilisticParentPointer: Fix locking
  • Decouple FreeList a bit from Partition (Stil located at Partition, but API decoupled)
  • Change Locking in FreeList (Exclusive Lock to CAS)
  • Add a few missing rechecks

itodnerd added 26 commits March 11, 2024 10:22
Fix error, if n < hw_threads
Better Balancing:
- we now give each thread ceil(n/hw_threads) work, therefore we steal a bit from last threads
- floor (n/hw_threads) would add work to the last thread.
- PageProvider: Total Evictions, total Touches, total Writes,
- Worker: Jumps, Misse, new_pages, tx

Refactor Profiling thread:
- Extract anonymous function to named function
- put configy_table and result_table in extra category (untimed_tables)
Refactor BufferManager and BTreeNode a bit

Add missing sum_no_reset from previous commit (profiling table)
Persist ssd_path
Persist some other value, that was earlier derived from the table, but strangely had some errors on multiple persist and recover run....

Add Functionality to Leanstore, to persist and retrieve persisted Strings by name.
Dont run tpcc tx if run for sec == 0 and run_until_tx == 0
Here just the data is created.
Remove "failed_attempts" from phase1 (unneeded, because only read before change)

Add a few comments to PageProvider Thread
Has its own latch -> update does not lock page, only parent pointer.
@itodnerd itodnerd requested a review from viktorleis March 11, 2024 13:19
@itodnerd itodnerd removed the request for review from viktorleis March 11, 2024 14:15
@itodnerd itodnerd marked this pull request as draft March 12, 2024 14:35
@itodnerd itodnerd marked this pull request as ready for review March 13, 2024 15:13
@adnan-alhomssi adnan-alhomssi self-requested a review June 6, 2024 11:27
< 10000 /span> Copy link
Contributor
@adnan-alhomssi adnan-alhomssi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a slight regression for in-memory SI tpc-c
./frontend/tpcc --tpcc_warehouse_count=2 --tpcc_warehouse_affinity --ssd_path=./ssd --worker_threads=2 --pp_threads=1 --dram_gib=20 --csv_path=./log --free_pct=1 --contention_split --xmerge --print_tx_console --run_for_seconds=60 --isolation_level=si

+-----+------------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+
| t   | OLTP TX    | RF %     | Abort%   | OLAP TX  | W MiB    | R MiB    | Instrs/- | Branch   | Cycles/- | CPUs     | L1/TX    | LLC/TX   | GHz      | WAL      | GCT      | Space G  | GCT      | touches  | evictio- |
|     |            |          |          |          |          |          | TX       | miss/TX  | TX       |          |          |          |          | GiB/s    | GiB/s    |          | Rounds   |          | ns       |
+-----+------------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+
| 1   | 46091      | 22.4035- | 0.000000 | 0        | 0.0      | 0.0      | 218277.- | 444.161- | 132171.- | 1.940588 | 1832.90- | 0.000000 | 6.227894 | 0.1      | 0.0      | 0.5      | 179115   | 0        | 0        |

+-----+------------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+
| t   | OLTP TX    | RF %     | Abort%   | OLAP TX  | W MiB    | R MiB    | Instrs/- | Cycles/- | CPUs     | L1/TX    | LLC/TX   | GHz      | WAL      | GCT      | Space G  | GCT      |
|     |            |          |          |          |          |          | TX       | TX       |          |          |          |          | GiB/s    | GiB/s    |          | Rounds   |
 1   | 52789      | 22.5084- | 0.000000 | 0        | 0.0      | 0.0      | 190514.- | 125488.- | 1.970990 | 1675.06- | 0.000000 | 6.678050 | 0.1      | 0.0      | 0.5      | 177638   |

@@ -22,6 +22,7 @@ DEFINE_bool(profile_latency, false, "");
DEFINE_bool(crc_check, false, "");
// -------------------------------------------------------------------------------------
DEFINE_uint32(worker_threads, 4, "");
DEFINE_uint32(creator_threads, 0, "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment to describe the difference between worker and creator thread?

@@ -142,52 +142,42 @@ u32 BTreeNode::spaceUsedBySlot(u16 s_i)
// -------------------------------------------------------------------------------------
// right survives, this gets reclaimed
// left(this) into right
bool BTreeNode::merge(u16 slotId, ExclusivePageGuard<BTreeNode>& parent, ExclusivePageGuard<BTreeNode>& right)
bool BTreeNode::merge(ExclusivePageGuard<BTreeNode>& self, u16 slotId, ExclusivePageGuard<BTreeNode>& parent, ExclusivePageGuard<BTreeNode>& right)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it buggy or why you made this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need access to both (left and right) bfs.header.tracker (To merge the two Timestamp-Trackers)

@@ -43,25 +45,139 @@ struct BufferFrame {
ContentionTracker contention_tracker;
// -------------------------------------------------------------------------------------
struct OptimisticParentPointer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you now using OptimisticParentPointer? It was used only in micro experiments

6D4E
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added a guard to remove some race conditions. it still is behind a flag

@@ -96,7 +96,10 @@ int main(int argc, char** argv)
ensure(ret);
table.insert({newest + 1}, {});
cr::Worker::my().commitTX();
COUNTERS_BLOCK() { WorkerCounters::myCounters().tx++; }
COUNTERS_BLOCK() {
WorkerCounters::myCounters().tx++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between tx and tx_counter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tx is for the statistics per second, tx_counter for the run statistics (not reset), see ResultsTable

@itodnerd
Copy link
Contributor Author
itodnerd commented Sep 2, 2024

There is a slight regression for in-memory SI tpc-c ./frontend/tpcc --tpcc_warehouse_count=2 --tpcc_warehouse_affinity --ssd_path=./ssd --worker_threads=2 --pp_threads=1 --dram_gib=20 --csv_path=./log --free_pct=1 --contention_split --xmerge --print_tx_console --run_for_seconds=60 --isolation_level=si

+-----+------------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+
| t   | OLTP TX    | RF %     | Abort%   | OLAP TX  | W MiB    | R MiB    | Instrs/- | Branch   | Cycles/- | CPUs     | L1/TX    | LLC/TX   | GHz      | WAL      | GCT      | Space G  | GCT      | touches  | evictio- |
|     |            |          |          |          |          |          | TX       | miss/TX  | TX       |          |          |          |          | GiB/s    | GiB/s    |          | Rounds   |          | ns       |
+-----+------------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+
| 1   | 46091      | 22.4035- | 0.000000 | 0        | 0.0      | 0.0      | 218277.- | 444.161- | 132171.- | 1.940588 | 1832.90- | 0.000000 | 6.227894 | 0.1      | 0.0      | 0.5      | 179115   | 0        | 0        |
+-----+------------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+----------+
| t   | OLTP TX    | RF %     | Abort%   | OLAP TX  | W MiB    | R MiB    | Instrs/- | Cycles/- | CPUs     | L1/TX    | LLC/TX   | GHz      | WAL      | GCT      | Space G  | GCT      |
|     |            |          |          |          |          |          | TX       | TX       |          |          |          |          | GiB/s    | GiB/s    |          | Rounds   |
 1   | 52789      | 22.5084- | 0.000000 | 0        | 0.0      | 0.0      | 190514.- | 125488.- | 1.970990 | 1675.06- | 0.000000 | 6.678050 | 0.1      | 0.0      | 0.5      | 177638   |

I can reproduce this.. (~10%) will have a look into it

@itodnerd
Copy link
Contributor Author

Fixed Efficiency problems... Now there seems to be an problem with the effectiveness...
Working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0