[{"data":1,"prerenderedAt":358},["ShallowReactive",2],{"docs-nav":3,"docs-page-\u002Fdocs\u002Ftopics\u002Fpartitions-and-records":133},[4,27,53,68,83,98,117],{"slug":5,"label":6,"pages":7},"get-started","Get Started",[8,12,17,22],{"path":9,"title":10,"order":11},"\u002Fdocs","Welcome",0,{"path":13,"title":14,"navTitle":15,"order":16},"\u002Fdocs\u002Fget-started\u002Fquickstart","Quickstart",null,1,{"path":18,"title":19,"navTitle":20,"order":21},"\u002Fdocs\u002Fget-started\u002Fconnect-to-a-cluster","Connecting to a Kafka Cluster","Clusters",2,{"path":23,"title":24,"navTitle":25,"order":26},"\u002Fdocs\u002Fget-started\u002Flicense","Licensing and Activation","License",3,{"slug":28,"label":29,"pages":30},"console","Console",[31,35,39,43,48],{"path":32,"title":33,"navTitle":34,"order":16},"\u002Fdocs\u002Fconsole\u002Foverview","Produce and Consume Messages in the Kafka Console","Overview",{"path":36,"title":37,"navTitle":38,"order":21},"\u002Fdocs\u002Fconsole\u002Fconsuming-messages","Kafka Consumer: Reading Messages from a Topic","Consuming",{"path":40,"title":41,"navTitle":42,"order":26},"\u002Fdocs\u002Fconsole\u002Fdecoding-messages","Decoding Kafka Avro and Protobuf Messages","Decoding",{"path":44,"title":45,"navTitle":46,"order":47},"\u002Fdocs\u002Fconsole\u002Fproducing-messages","Kafka Producer: Sending Messages to a Topic","Producing",4,{"path":49,"title":50,"navTitle":51,"order":52},"\u002Fdocs\u002Fconsole\u002Freplay-forward-and-export","Replay and Export Kafka Messages","Replay & export",5,{"slug":54,"label":55,"pages":56},"topics","Topics",[57,60,64],{"path":58,"title":59,"navTitle":34,"order":16},"\u002Fdocs\u002Ftopics\u002Foverview","Browse and Inspect Kafka Topics",{"path":61,"title":62,"navTitle":63,"order":21},"\u002Fdocs\u002Ftopics\u002Fcreate-a-topic","Create a Kafka Topic: Partitions, Replication, and Retention","Create a topic",{"path":65,"title":66,"navTitle":67,"order":26},"\u002Fdocs\u002Ftopics\u002Fpartitions-and-records","Adding Kafka Partitions and Deleting Records","Partitions & records",{"slug":69,"label":70,"pages":71},"schema-registry","Schema Registry",[72,75,79],{"path":73,"title":74,"navTitle":34,"order":16},"\u002Fdocs\u002Fschema-registry\u002Foverview","Browse Kafka Schema Registry Subjects and Versions",{"path":76,"title":77,"navTitle":78,"order":21},"\u002Fdocs\u002Fschema-registry\u002Fnew-versions","Register Kafka Schemas and Publish New Versions","New versions",{"path":80,"title":81,"navTitle":82,"order":26},"\u002Fdocs\u002Fschema-registry\u002Fmock-and-lab","Avro Schema Validator and Mock Data Generator","Mock & Lab",{"slug":84,"label":85,"pages":86},"consumer-groups","Consumer Groups",[87,90,94],{"path":88,"title":89,"navTitle":34,"order":16},"\u002Fdocs\u002Fconsumer-groups\u002Foverview","Browse Kafka Consumer Groups and Assignments",{"path":91,"title":92,"navTitle":93,"order":21},"\u002Fdocs\u002Fconsumer-groups\u002Flag","Monitor Kafka Consumer Lag","Lag",{"path":95,"title":96,"navTitle":97,"order":26},"\u002Fdocs\u002Fconsumer-groups\u002Freset-offsets","Reset Kafka Consumer Group Offsets","Reset offsets",{"slug":99,"label":100,"pages":101},"data-clone","Data Clone",[102,105,109,113],{"path":103,"title":104,"navTitle":34,"order":16},"\u002Fdocs\u002Fdata-clone\u002Foverview","Clone Kafka Topics Between Clusters",{"path":106,"title":107,"navTitle":108,"order":21},"\u002Fdocs\u002Fdata-clone\u002Fscope-and-range","Configure Kafka Topic Cloning","Scope & range",{"path":110,"title":111,"navTitle":112,"order":26},"\u002Fdocs\u002Fdata-clone\u002Fmasking","Mask Sensitive Data in Kafka Messages","Masking",{"path":114,"title":115,"navTitle":116,"order":47},"\u002Fdocs\u002Fdata-clone\u002Fpre-flight","Run Pre-flight Checks Before a Kafka Data Clone","Pre-flight",{"slug":118,"label":119,"pages":120},"operate","Operate",[121,125,129],{"path":122,"title":123,"navTitle":124,"order":16},"\u002Fdocs\u002Foperate\u002Fbrokers","Inspect Kafka Brokers and Cluster Configuration","Brokers",{"path":126,"title":127,"navTitle":128,"order":21},"\u002Fdocs\u002Foperate\u002Faccess-control","Inspect Kafka ACLs and Simulate Access","Access Control",{"path":130,"title":131,"navTitle":132,"order":26},"\u002Fdocs\u002Foperate\u002Factivity-logs","Review Kafka Changes in Kafma Activity Logs","Activity Logs",{"id":134,"title":66,"body":135,"description":349,"extension":350,"lastUpdated":351,"meta":352,"navTitle":67,"navigation":353,"order":26,"path":65,"seo":354,"sitemap":355,"stem":356,"__hash__":357},"docs\u002Fdocs\u002Ftopics\u002Fpartitions-and-records.md",{"type":136,"value":137,"toc":334},"minimark",[138,142,147,150,153,157,169,178,181,186,189,192,196,199,203,206,218,222,229,232,240,244,247,255,259,262,265,269,280,302,313,317],[139,140,141],"p",{},"Partitions control how Kafka distributes records and parallelizes consumption.\nKafma can increase a topic's partition count or remove its retained records\nwithout deleting the topic. Neither operation can be undone.",[143,144,146],"h2",{"id":145},"how-kafka-topics-and-partitions-work","How Kafka topics and partitions work",[139,148,149],{},"A Kafka topic contains one or more partitions. Each partition is an ordered log\nwith its own offsets. Kafka guarantees record order within a partition, not across\nthe whole topic.",[139,151,152],{},"Within a consumer group, each partition is assigned to one member at a time.\nAdding partitions can increase consumption parallelism, but only when the group\nhas enough members to use them.",[143,154,156],{"id":155},"add-partitions-to-a-kafka-topic","Add partitions to a Kafka topic",[139,158,159,160,164,165,168],{},"Open the topic's action menu and select ",[161,162,163],"strong",{},"Add Partitions",", or click ",[161,166,167],{},"Add"," in\nthe topic details drawer. Enter the new total partition count, not the number to\nadd. The value must be greater than the current count.",[139,170,171],{},[172,173],"img",{"alt":174,"height":175,"src":176,"width":177},"Adding Kafka partitions by entering a new total partition count in the topic details drawer",784,"https:\u002F\u002Fmedia.kafma.app\u002Fdocs\u002Ftopics\u002Fpartitions-and-records\u002Fadd-partition.png",1564,[139,179,180],{},"Kafka can add partitions to a live topic, but it cannot remove them. To return to\na lower count, create another topic and migrate the records.",[182,183,185],"h3",{"id":184},"key-routing-and-ordering","Key routing and ordering",[139,187,188],{},"Keyed records are routed using the producer's partitioner and the available\npartition count. After the count changes, the same key may map to a different\npartition. Existing records stay where they are.",[139,190,191],{},"Records for one key can therefore be split between its old and new partitions.\nKafka provides no ordering guarantee between them. If an application depends on\nper-key ordering to rebuild state, creating a new topic and replaying into it is\nsafer than expanding the existing topic.",[182,193,195],{"id":194},"compacted-kafka-topics","Compacted Kafka topics",[139,197,198],{},"Compaction runs independently in each partition. If a key moves after partitions\nare added, its old value and new value can remain in different partitions. A\nconsumer rebuilding state may then encounter both.",[143,200,202],{"id":201},"delete-records-from-a-kafka-topic","Delete records from a Kafka topic",[139,204,205],{},"Kafma can delete records from the entire topic or from one partition. Both actions\nuse Kafka's Delete Records operation to move the selected partitions' low\nwatermarks to their current high watermarks. The records become unreadable, while\nKafka reclaims their storage asynchronously.",[139,207,208,209,213,214,217],{},"The topic's ",[210,211,212],"code",{},"cleanup.policy"," must include ",[210,215,216],{},"delete",", so delete-only and mixed-policy\ntopics are supported. The action is unavailable on compact-only topics and\nread-only connections.",[182,219,221],{"id":220},"delete-all-retained-records","Delete all retained records",[139,223,224,225,228],{},"From the Topics list, open the topic's action menu and select ",[161,226,227],{},"Delete Records",".\nKafma truncates every non-empty partition to the high watermark captured when the\noperation starts.",[139,230,231],{},"This clears or purges the records retained at that point. The topic, its\npartitions, and its configuration remain, and producers can continue writing new\nrecords.",[139,233,234],{},[172,235],{"alt":236,"height":237,"src":238,"width":239},"Delete Records confirmation warning that all retained records will be removed while partitions and configuration remain",606,"https:\u002F\u002Fmedia.kafma.app\u002Fdocs\u002Ftopics\u002Fpartitions-and-records\u002Fdelete-topic-records.png",924,[182,241,243],{"id":242},"clear-one-partition","Clear one partition",[139,245,246],{},"Open the topic details drawer and hover over a partition to reveal the clear icon.\nClick it, review the number of records that will be deleted, and confirm. Kafma\ntruncates that partition to its current high watermark without changing the other\npartitions.",[139,248,249],{},[172,250],{"alt":251,"height":252,"src":253,"width":254},"Confirming deletion of all retained records from one Kafka partition",864,"https:\u002F\u002Fmedia.kafma.app\u002Fdocs\u002Ftopics\u002Fpartitions-and-records\u002Fdelete-partition-records.png",756,[182,256,258],{"id":257},"why-you-cannot-delete-one-message","Why you cannot delete one message",[139,260,261],{},"Kafka's Delete Records API can only remove a contiguous prefix before a specified\noffset in each partition. It cannot remove one record from the middle while\npreserving the records around it.",[139,263,264],{},"Kafma does not currently expose a custom cutoff offset. The topic action uses the\ncurrent high watermark for every non-empty partition, while the partition action\nuses the selected partition's current high watermark. The selected topic or\npartition is therefore cleared completely.",[182,266,268],{"id":267},"what-consumers-see-after-deletion","What consumers see after deletion",[139,270,271,272,275,276,279],{},"A consumer group may have a committed offset below the new low watermark. Its next\nfetch then returns ",[210,273,274],{},"OFFSET_OUT_OF_RANGE",", and the consumer's ",[210,277,278],{},"auto.offset.reset","\nsetting determines what happens:",[281,282,283,290,296],"ul",{},[284,285,286,289],"li",{},[210,287,288],{},"earliest"," resumes from the new earliest offset.",[284,291,292,295],{},[210,293,294],{},"latest"," resumes at the end.",[284,297,298,301],{},[210,299,300],{},"none"," returns an error.",[139,303,304,305,312],{},"Deleting records does not delete consumer groups or reset their committed\noffsets. Check the topic's\n",[306,307,309],"a",{"href":308},"\u002Fdocs\u002Ftopics\u002Foverview#consumer-groups",[161,310,311],{},"Consumers"," section before clearing\ndata that an application still needs.",[143,314,316],{"id":315},"next-steps","Next steps",[281,318,319,324,329],{},[284,320,321],{},[306,322,323],{"href":58},"Browse and inspect Kafka topics",[284,325,326],{},[306,327,328],{"href":61},"Create a Kafka topic",[284,330,331],{},[306,332,333],{"href":36},"Read messages from a topic",{"title":335,"searchDepth":26,"depth":26,"links":336},"",[337,338,342,348],{"id":145,"depth":21,"text":146},{"id":155,"depth":21,"text":156,"children":339},[340,341],{"id":184,"depth":26,"text":185},{"id":194,"depth":26,"text":195},{"id":201,"depth":21,"text":202,"children":343},[344,345,346,347],{"id":220,"depth":26,"text":221},{"id":242,"depth":26,"text":243},{"id":257,"depth":26,"text":258},{"id":267,"depth":26,"text":268},{"id":315,"depth":21,"text":316},"Add partitions to a Kafka topic or delete records in Kafma. See how these irreversible operations affect key routing, ordering, and consumers.","md","2026-08-01",{},true,{"title":66,"description":349},{"loc":65},"docs\u002Ftopics\u002Fpartitions-and-records","wiW8kudQ0gv1pSDpiXan3Z13H8CpT1w-a0a0WBz3Fz8",1785561255907]