Skip to content
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

3.2 Enable backups over CC transaction protocol #9872

Merged
merged 3 commits into from
Sep 29, 2017

Conversation

phughk
Copy link
Contributor

@phughk phughk commented Aug 22, 2017

Currently we have a separate protocol for backups. This protocol is used in HA but also in the backup tool (neo4j-admin).
Introducing this change enables neo4j-admin backup to work with CC endpoints without any change of configuration.

@phughk phughk changed the title 3.2 Enable doing backups over CC Raft protocol 3.2 Enable backups over CC Raft protocol Aug 22, 2017
int maxPages = 1024;
PageSwapperFactory pageSwapperFactory = new SingleFilePageSwapperFactory();
pageSwapperFactory.setFileSystemAbstraction( fileSystemAbstraction );
return new MuninnPageCache( pageSwapperFactory, maxPages, cachePageSize, pageCacheTracer, pageCursorTracerSupplier );
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 intentionally ignoring the page cache configurations in neo4j.conf? In doing so, we can no longer do an online backup directly to block device storage, but have to change the procedure to back up to file storage and then import onto block device storage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not intentionally - I will fix that, thanks!

@phughk phughk force-pushed the 3.2-backupRaft branch 12 times, most recently from 8258a5a to f670ff2 Compare August 25, 2017 16:10
@phughk phughk force-pushed the 3.2-backupRaft branch 11 times, most recently from 65e990e to dd9954f Compare September 4, 2017 14:34
}
return (E) e;
}
throw new RuntimeException( "The code expected to fail hasn't failed" );
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you want to throw AssertionErrors instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in next push

}
} );
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it always enabled, and the extension is registered automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should always be disabled for CC (there is no need in maintaining it, since the neo4j-admin will be the same version as the cc running). But you are saying it is registered automatically? That is what I need to avoid (@Ignore in OnlineBackupCommandCcIt)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved - CC (core+RR) no longer have the backup protocol

import org.neo4j.test.ProcessStreamHandler;
import org.neo4j.test.rule.TestDirectory;

public class JvmRunner
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems pretty backup specific. Maybe just add them as more static methods to org.neo4j.backup.util.TestHelpers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it contains @Rule TestDirectory then it is expected to be extended from. The method that doesn't require NEO4J_HOME depends on the TestDirectory. Also it had to be moved to enterprise/kernel because there are tests in causal clustering (if I recall) that use this as well. Its a maven tree thing essentially

Copy link
Contributor

Choose a reason for hiding this comment

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

OnlineBackupCommandCcIT is the only test that uses that feature of it, and it could just as well have its own TestDirectory.

Copy link
Contributor

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

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

Did a second round of review. Still nits to pick.

@phughk phughk force-pushed the 3.2-backupRaft branch 2 times, most recently from 23c3f70 to 1c54ab5 Compare September 19, 2017 07:56
@chrisvest
Copy link
Contributor

You got a couple of compilation failures.

@phughk phughk force-pushed the 3.2-backupRaft branch 5 times, most recently from 706e39e to 35b812c Compare September 19, 2017 15:23
@phughk phughk force-pushed the 3.2-backupRaft branch 2 times, most recently from aaa2742 to 0b74576 Compare September 20, 2017 07:48
@phughk
Copy link
Contributor Author

phughk commented Sep 20, 2017

Conflicts are being resolved in linked PR

@phughk phughk force-pushed the 3.2-backupRaft branch 3 times, most recently from 2a5387e to 29813de Compare September 25, 2017 08:09
@phughk phughk force-pushed the 3.2-backupRaft branch 3 times, most recently from f95a881 to 61320ee Compare September 27, 2017 07:47
Before this commit, CC is dependant on backup.
Applying this commit will shuffle dependencies around to be more sensible
Backup tool works over transaction protocol
CC (core, RR) have the backup protocol disabled PERMANENTLY (switching option won't change anything)
HA backup protocol still supported as it had before
Moved JvmRunner code to TestHelpers
Moved TestHelpers to enterprise kernel
Resolved CC starting Backup protocol unintentionally.
@phughk phughk merged commit 46d0289 into neo4j:3.2 Sep 29, 2017
phughk added a commit to phughk/neo4j-old that referenced this pull request Sep 29, 2017
This reverts commit 46d0289, reversing
changes made to 48c0290.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants