Do you have any replication slots on the replica? When you created the replica, you were supposed to exclude the directory pg_replslot. If you didn't the replica might have "inherited" slots it should not have.
Is this command succeeding? Do you see messages in the log file about it failing? Are new files showing up in '/data/tablespaces/archivedir/'? Does the master have any old replication slots which have been abandoned or are falling behind? Check the view pg_replication_slots.
pg_archivecleanup is for cleaning up the archive (which is apparently '/data/tablespaces/archivedir/'). It is *not* for cleaning up pg_wal. Cheers, Jeff |