-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unified snapshots configuration for datanode (#21031)
* Preflight check for usable space and cache size * add warning when search cache size occupies more than 80% of free disk space * Added changelog * unified searchable snapshots configuration for datanode * removed node cache from OpensearchConfiguration (is managed by searchable snaphots config) * code cleanup * better node search cache documentation * updated changelog --------- Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
- Loading branch information
1 parent
5cdcb0e
commit fe5102b
Showing
14 changed files
with
571 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
type = "a" | ||
message = "Unified snapshot configuration, role and cache management in datanode" | ||
|
||
pulls = ["21031"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ain/java/org/graylog/datanode/opensearch/configuration/OpensearchUsableSpaceProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
package org.graylog.datanode.opensearch.configuration; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.inject.Provider; | ||
import jakarta.inject.Singleton; | ||
import org.graylog.datanode.configuration.DatanodeConfiguration; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.FileStore; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
@Singleton | ||
public class OpensearchUsableSpaceProvider implements Provider<OpensearchUsableSpace> { | ||
|
||
private final Path dataTargetDir; | ||
|
||
@Inject | ||
public OpensearchUsableSpaceProvider(DatanodeConfiguration datanodeConfiguration) { | ||
dataTargetDir = datanodeConfiguration.datanodeDirectories().getDataTargetDir(); | ||
} | ||
|
||
@Override | ||
public OpensearchUsableSpace get() { | ||
return new OpensearchUsableSpace(dataTargetDir, getUsableSpace(dataTargetDir)); | ||
} | ||
|
||
private static long getUsableSpace(Path opensearchDataLocation) { | ||
final FileStore fileStore; | ||
try { | ||
fileStore = Files.getFileStore(opensearchDataLocation); | ||
return fileStore.getUsableSpace(); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...java/org/graylog/datanode/opensearch/configuration/beans/OpensearchConfigurationBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
package org.graylog.datanode.opensearch.configuration.beans; | ||
|
||
public interface OpensearchConfigurationBean { | ||
OpensearchConfigurationPart buildConfigurationPart(); | ||
} |
Oops, something went wrong.