Skip to content

Commit 3af1d48

Browse files
jerrypengsijie
authored andcommitted
fixing bug in snapshot manager (apache#204)
1 parent a9c2437 commit 3af1d48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionMetaDataSnapshotManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ List<Integer> getSnapshotTopics() {
160160
try {
161161
List<String> topics = pulsarAdmin.persistentTopics().getList(namespace);
162162
for (String topic : topics) {
163-
if (topic.startsWith(snapshotTopicPath)) {
163+
String prefix = String.format("%s/snapshot-", snapshotTopicPath);
164+
if (topic.startsWith(prefix)) {
164165
ret.add(Integer.parseInt(
165-
topic.replace(
166-
String.format("%s/snapshot-", snapshotTopicPath, snapshotsTopicPath), "")));
166+
topic.replace(prefix, "")));
167167
}
168168
}
169169
} catch (PulsarAdminException e) {

0 commit comments

Comments
 (0)