You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Jens Fischer <J....@sonnen.de> on 2021/04/07 15:41:51 UTC

Log Rotation of Extended Compaction Logging

Hi,

Does anybody know the configuration for Extended Compaction Logging[1]? When is a log rotation triggered and how many files are kept?

I did some googling, found [2] and checked the configuration in /etc/cassandra/logback.xml, neither does mention anything about compaction logging.

I am using Cassandra 3.11.6.

Any help is appreciated.

Best Regards
Jens

[1]: https://docs.datastax.com/en/cql-oss/3.x/cql/cql_reference/cqlCreateTable.html?hl=log_all#compactSubprop__enabling-extended-compaction-logging
[2]: https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/configLoggingLevels.html


Gesch?ftsf?hrer: Jean-Baptiste Cornefert, Oliver Koch, Bianca Swanston
Amtsgericht Kempten/Allg?u, Registernummer: 10655, Steuernummer 127/137/50792, USt.-IdNr. DE272208908

Re: Log Rotation of Extended Compaction Logging

Posted by Kane Wilson <k...@raft.so>.
Correct. It's also worth noting that if you delete log files and restart C*
the CompactionLogger will then find the earliest available file number
starting from 0. You'll have to explore what you can use to configure
proper log rotation as the CompactionLogger doesn't use the logging system
to write out to files.

raft.so - Cassandra consulting, support, and managed services


On Fri, Apr 9, 2021 at 7:38 PM Jens Fischer <J....@sonnen.de> wrote:

> Hi Erik,
>
> thank you for the link, very instructive.
>
> To summarise my understanding of your mail, the code and my experiments:
>
> - as long as the compaction logger is running it will write into the same
> “compaction.log" file
> - if a new logger gets started (for example through restart of the
> Cassandra Node) the file current file will be moved to
> “compaction-<sequence number>.log” and a new  “compaction.log" file will be
> created
> - files will never be archived (compressed) or deleted
>
> Correct?
>
> Best
> Jens
> Geschäftsführer: Jean-Baptiste Cornefert, Oliver Koch, Bianca Swanston
> Amtsgericht Kempten/Allgäu, Registernummer: 10655, Steuernummer
> 127/137/50792, USt.-IdNr. DE272208908
>

Re: Log Rotation of Extended Compaction Logging

Posted by Jens Fischer <J....@sonnen.de>.
Hi Erik,

thank you for the link, very instructive.

To summarise my understanding of your mail, the code and my experiments:

- as long as the compaction logger is running it will write into the same “compaction.log" file
- if a new logger gets started (for example through restart of the Cassandra Node) the file current file will be moved to “compaction-<sequence number>.log” and a new  “compaction.log" file will be created
- files will never be archived (compressed) or deleted

Correct?

Best
Jens
Geschäftsführer: Jean-Baptiste Cornefert, Oliver Koch, Bianca Swanston
Amtsgericht Kempten/Allgäu, Registernummer: 10655, Steuernummer 127/137/50792, USt.-IdNr. DE272208908

Re: Log Rotation of Extended Compaction Logging

Posted by Erick Ramirez <er...@datastax.com>.
As far as I'm aware, the compaction logs don't get rotated. It looks like
it just increments the sequence number by 1.

You can have a look at the logic here --
https://github.com/apache/cassandra/blob/cassandra-3.11.6/src/java/org/apache/cassandra/db/compaction/CompactionLogger.java#L303-L318.
Cheers!

>