Merge branch 'cassandra-5.0' into trunk

This commit is contained in:
Jon Meredith 2025-02-05 13:53:32 -07:00
commit eb43f7b4d4
2 changed files with 20 additions and 15 deletions

View File

@ -129,6 +129,7 @@
* Add the ability to disable bulk loading of SSTables (CASSANDRA-18781)
* Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787)
Merged from 5.0:
* Skip check for DirectIO when initializing tools (CASSANDRA-20289)
* Avoid under-skipping during intersections when an iterator has mixed STATIC and WIDE keys (CASSANDRA-20258)
* Correct the default behavior of compareTo() when comparing WIDE and STATIC PrimaryKeys (CASSANDRA-20238)
* Make sure we can set parameters when configuring CassandraCIDRAuthorizer (CASSANDRA-20220)

View File

@ -1598,24 +1598,28 @@ public class DatabaseDescriptor
{
boolean compressOrEncrypt = getCommitLogCompression() != null || (getEncryptionContext() != null && getEncryptionContext().isEnabled());
boolean directIOSupported = false;
try
// File.getBlockSize creates directories/files tools may not have permissions for
if (!toolInitialized)
{
String commitLogLocation = getCommitLogLocation();
try
{
String commitLogLocation = getCommitLogLocation();
if (commitLogLocation == null)
throw new ConfigurationException("commitlog_directory must be specified", false);
if (commitLogLocation == null)
throw new ConfigurationException("commitlog_directory must be specified", false);
File commitLogLocationDir = new File(commitLogLocation);
PathUtils.createDirectoriesIfNotExists(commitLogLocationDir.toPath());
directIOSupported = FileUtils.getBlockSize(commitLogLocationDir) > 0;
}
catch (IOError | ConfigurationException ex)
{
throw ex;
}
catch (RuntimeException e)
{
logger.warn("Unable to determine block size for commit log directory: {}", e.getMessage());
File commitLogLocationDir = new File(commitLogLocation);
PathUtils.createDirectoriesIfNotExists(commitLogLocationDir.toPath());
directIOSupported = FileUtils.getBlockSize(commitLogLocationDir) > 0;
}
catch (IOError | ConfigurationException ex)
{
throw ex;
}
catch (RuntimeException e)
{
logger.warn("Unable to determine block size for commit log directory: {}", e.getMessage());
}
}
if (providedDiskAccessMode == DiskAccessMode.auto)