compaction: LCS: Fix off-by-one in formula used to calculate ideal level
compaction: LCS: Fix off-by-one in formula used to calculate ideal level

To calculate ideal level, we use the formula:
	log 10 (input_size / max_fragment_size)

input_size / max_fragment_size is calculating number of fragments.

the problem is that the calculation can miss the last fragment, so
wrong level may be picked if last fragment would cause the target
level to exceed its capacity.

To fix it, let's tweak the formula to:
	log 10 ((input_size + max_fragment_size - 1) / max_fragment_size)

such that the actual # of fragments will be calculated.

If wrong level is picked, it can cause unnecessary writeamp as,
LCS will later have to promote data into the next level.

Problem spotted by Benny Halevy.

Fixes #10458.

Signed-off-by: Raphael S. Carvalho <1e2942cea40e3b4d2162dfcd9e53e41c05a84d22@scylladb.com>

scylladb/scylla,scylladb/scylla,scylladb/scylla,scylladb/scylla