8000 Add FIXMEs to note what needs doing. by neunhoef · Pull Request #3221 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Add FIXMEs to note what needs doing. #3221

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion arangod/Agency/Agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void Agent::reportIn(std::string const& peerId, index_t index, size_t toLog) {
}

// TODO: why _liLock here, should by _ioLock, and we already have it
// FIXME: Deal with this TODO
MUTEX_LOCKER(liLocker, _liLock);
_commitIndex = index;
if (_commitIndex >= _nextCompactionAfter) {
Expand Down Expand Up @@ -398,6 +399,10 @@ bool Agent::recvAppendEntriesRPC(
_liLock.assertNotLockedByCurrentThread();
MUTEX_LOCKER(ioLocker, _ioLock);

// FIXME: We must hold the _logLock the moment above where we restored
// from a snapshot until the append to the log further down in this
// function, or else, _log can be found empty or in some bad state
// by somebody else in the meantime.
size_t ndups = _state.removeConflicts(queries, gotSnapshot);

if (nqs > ndups) {
Expand All @@ -407,7 +412,8 @@ bool Agent::recvAppendEntriesRPC(

try {

MUTEX_LOCKER(ioLocker, _liLock);
MUTEX_LOCKER(ioLocker, _liLock); // FIXME: _liLock: still necessary?
// FIXME: _leaderCommitIndex no longer exists.
_lastApplied = _state.log(queries, ndups);
if (_lastApplied < payload[nqs-1].get("index").getNumber<index_t>()) {
// We could not log all the entries in this query, we need to report
Expand Down
1 change: 1 addition & 0 deletions arangod/Agency/Agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ class Agent : public arangodb::Thread,
mutable arangodb::Mutex _ioLock;

// lock for _leaderCommitIndex
// FIXME: _leaderCommitIndex does no longer exist.
mutable arangodb::Mutex _liLock;

// note: when both _ioLock and _liLock are acquired,
Expand Down
0