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
Diskless cluster mode v2 #676
Conversation
- only one node handles data - use ZooKeeper 'multi' operation to ensure leadership while dealing with metadata in BKDataStorageManager - followers only announce them on metadata - new 'replica:*' parameter to tell that evey node is a replica and can become leader - add tests
40ede74
to
d130770
Compare
@dcdiennea @dmercuriali @amitvc @diegosalvi PTAL |
@nicoloboschi I added more details as you requested offline, PTAL |
@@ -1207,8 +1256,9 @@ private static LogSequenceNumber readLogSequenceNumberFromIndexMetadataFile(Stri | |||
@Override | |||
public List<Table> loadTables(LogSequenceNumber sequenceNumber, String tableSpace) throws DataStorageManagerException { | |||
try { | |||
String tableSpaceDirectory = getTableSpaceZNode(tableSpace); | |||
ensureZNodeDirectory(tableSpaceDirectory); | |||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl leftovers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually this is no more needed.
I am dropping this commented code, thanks
@@ -1259,8 +1309,9 @@ private static LogSequenceNumber readLogSequenceNumberFromIndexMetadataFile(Stri | |||
@Override | |||
public List<Index> loadIndexes(LogSequenceNumber sequenceNumber, String tableSpace) throws DataStorageManagerException { | |||
try { | |||
String tableSpaceDirectory = getTableSpaceZNode(tableSpace); | |||
ensureZNodeDirectory(tableSpaceDirectory); | |||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl leftovers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually this is no more needed.
I am dropping this commented code, thanks
@@ -81,6 +81,10 @@ private TableSpace( | |||
this.metadataStorageCreationTime = metadataStorageCreationTime; | |||
} | |||
|
|||
public boolean isNodeAssignedToTableSpace(String nodeId) { | |||
return this.replicas.contains(nodeId) || this.replicas.contains("*"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use a constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I'm thinking that in the future a ledger cache on disk could be helpful |
In my opinion copying data locally can help reads but it will add additional write amplification. So we should look for a good use case |
@diegosalvi this is the link to travis |
Travis passed @diegosalvi your comments have been addressed. I am merging this patch now |
This is a second version of the experimental diskless-cluster mode.
Recap about "diskless cluster mode":
With mode=diskless-cluster we are storing data pages and index pages on BookKeeper instead of the local disk.
In this mode the local disk is used only for tmpDirectory, to swap temporary resulsets (that do not survive to the restart of the server).
In order to store data on BK we created BookKeeperDataStorageManager, and generally this works this way:
Differences from v1:
Problems with v1 addressed by this PR: