Preheat oven to 350°F (175°C) and line a 9x9 inch baking pan with parchment paper, leaving overhang on two sides.
Whisk flour, brown sugar, cinnamon, and salt. Cut in cold cubed butter until pea-sized crumbs form. Stir in pecans if using. Refrigerate while making batter.
Whisk flour, baking powder, baking soda, and salt in a medium bowl until well combined.
Beat softened butter and granulated sugar with a hand mixer for 2-3 minutes until pale and fluffy.
Add eggs one at a time, beating well after each, then mix in vanilla extract until combined.
Stir in sourdough discard and sour cream until smooth and creamy.
Gently fold dry ingredients into wet mixture with a spatula until just combined, being careful not to overmix.
Spread half of batter in prepared pan, sprinkle with half the streusel, top with remaining batter, and finish with remaining streusel on top.
Bake for 40-45 minutes until a toothpick inserted in center comes out clean or with just a few moist crumbs.
Cool in pan on a wire rack for 20 minutes before lifting out to cool completely.
For glaze, whisk powdered sugar, vanilla, and heavy cream until smooth and drizzle over cooled cake.
Lift cake from pan using parchment overhang, slice into 9 squares, and serve at room temperature.