Skip to content

Commit

Permalink
Revert test hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerkaraszewski committed Jun 21, 2024
1 parent e146093 commit ed58715
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sqlitecluster/SQLite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void SQLite::commonConstructorInitialization(bool hctree) {

// I tested and found that we could set about 10,000,000 and the number of steps to run and get a callback once a
// second. This is set to be a bit more granular than that, which is probably adequate.
sqlite3_progress_handler(_db, 100, _progressHandlerCallback, this);
sqlite3_progress_handler(_db, 1'000'000, _progressHandlerCallback, this);

// Setting a wal hook prevents auto-checkpointing.
sqlite3_wal_hook(_db, _walHookCallback, this);
Expand Down
11 changes: 3 additions & 8 deletions sqlitecluster/SQLiteNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2083,8 +2083,6 @@ void SQLiteNode::_changeState(SQLiteNodeState newState, uint64_t commitIDToCance
}
}

static int __ATTEMPTS = 0;

void SQLiteNode::_queueSynchronize(const SQLiteNode* const node, SQLitePeer* peer, SQLite& db, SData& response, bool sendAll) {
// We need this to check the state of the node, and we also need `name` to make the logging macros work in a static
// function. However, if you pass a null pointer here, we can't set these, so we'll fail. We also can't log that,
Expand All @@ -2110,6 +2108,8 @@ void SQLiteNode::_queueSynchronize(const SQLiteNode* const node, SQLitePeer* pee
// Instead of reconnecting, we tell the peer that we don't match. It's up to the peer to reconnect.
response["hashMismatchValue"] = myHash;
response["hashMismatchNumber"] = to_string(peerCommitCount);

return;
}
PINFO("Latest commit hash matches our records, beginning synchronization.");
} else {
Expand Down Expand Up @@ -2139,12 +2139,7 @@ void SQLiteNode::_queueSynchronize(const SQLiteNode* const node, SQLitePeer* pee
// We set this for all commits because this only gets all commits in response to SUBSCRIBE, which is done synchronously, and blocks the commit thread.
// For asynchronous queries, there's nothing being blocked, so it doesn't much matter how long these take.
// This is really not the correct encapsulation for this, but we can improve that later.
if (__ATTEMPTS) {
timeoutLimitUS = 10'000;
} else {
timeoutLimitUS = 100;
}
__ATTEMPTS++;
timeoutLimitUS = 10'000'000;
} else {
toIndex = min(toIndex, fromIndex + 100); // 100 transactions at a time
}
Expand Down

0 comments on commit ed58715

Please sign in to comment.