[ 
https://issues.apache.org/jira/browse/CASSANDRA-20510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17940730#comment-17940730
 ] 

Stefan Miklosovic commented on CASSANDRA-20510:
-----------------------------------------------

It boils down to this in StorageService

{code}
    public UUID getLocalHostUUID()
    {
        // Metadata collector requires using local host id, and flush of 
IndexInfo may race with
        // creation and initialization of cluster metadata service. Metadata 
collector does accept
        // null localhost ID values, it's just that TokenMetadata was created 
earlier.
        ClusterMetadata metadata = ClusterMetadata.currentNullable();
        if (metadata == null || 
metadata.directory.peerId(getBroadcastAddressAndPort()) == null)
            return null;
        return metadata.directory.peerId(getBroadcastAddressAndPort()).toUUID();
    }
{code}

in SimpleSSTableMultiWriter#create method there is

{code}
        MetadataCollector metadataCollector = new 
MetadataCollector(metadata.get().comparator)
                                              
.commitLogIntervals(commitLogPositions != null ? commitLogPositions : 
IntervalSet.empty())
                                              .sstableLevel(sstableLevel);
{code}

which uses this constructor:

{code}
    public MetadataCollector(ClusteringComparator comparator)
    {
        this(comparator, StorageService.instance.getLocalHostUUID());
    }
{code}

which returns null and then in CommitLogReplayer#persistedIntervals it gets it 
as null, hm ... 

So, CommitLogReplayer#persistedIntervals is executed sooner than metadata are 
initialized as it returns null only in that case. 

> Investigate uknown sstables warning in CommitLogReplayer
> --------------------------------------------------------
>
>                 Key: CASSANDRA-20510
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20510
>             Project: Apache Cassandra
>          Issue Type: Bug
>            Reporter: Stefan Miklosovic
>            Priority: Normal
>
> This is reproducible locally in trunk (5.1-SNAPSHOT), be sure to have empty 
> data dir and execute:
> bin/cassandra -f
> then shut it down, start again. There is this in the logs:
> {code}
> INFO  [main] 2025-04-03 16:36:04,572 CommitLog.java:206 - Replaying 
> ./bin/../data/commitlog/CommitLog-9-1743690864518.log
> WARN  [main] 2025-04-03 16:36:04,579 CommitLogReplayer.java:355 - Origin of 1 
> sstables is unknown or doesn't match the local node; commitLogIntervals for 
> them were ignored
> WARN  [main] 2025-04-03 16:36:04,579 CommitLogReplayer.java:355 - Origin of 2 
> sstables is unknown or doesn't match the local node; commitLogIntervals for 
> them were ignored
> WARN  [main] 2025-04-03 16:36:04,579 CommitLogReplayer.java:355 - Origin of 3 
> sstables is unknown or doesn't match the local node; commitLogIntervals for 
> them were ignored
> WARN  [main] 2025-04-03 16:36:04,579 CommitLogReplayer.java:355 - Origin of 2 
> sstables is unknown or doesn't match the local node; commitLogIntervals for 
> them were ignored
> INFO  [main] 2025-04-03 16:36:04,600 CommitLogReader.java:257 - Finished 
> reading ./bin/../data/commitlog/CommitLog-9-1743690864518.log
> {code}
> There is no reason to have unknown origin, it is the only node in the cluster 
> etc ... Pretty suspicious. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to