Season the flour with salt and pepper, and toss the lamb shanks in it to coat them well. Heat half the oil in a large skillet set over medium-high heat and brown the lamb on all sides, working in batches so the pan isn’t crowded. As you brown the shanks, place them in a roasting pan. Preheat the oven to 325°F.
Add the remaining oil to the skillet and sauté the onions, celery, and carrots for about 10 minutes, until soft. Add the garlic, tomato paste, rosemary, bay leaf, and pepper and cook for another 2-3 minutes.
Add the wine, vinegar, and sugar and bring to a simmer. Add the stock and bring it to a boil. Pour over the lamb shanks in the roasting pan and cover tightly with a lid or with foil.
Bake for an hour, then remove the lid and cook for another 2-2 1/2 hours, turning the lamb shanks every half hour or so, until the meat is fall-off-the-bone tender.
Remove the lamb from the sauce and strain as much fat from it as you can. If you like, strain out the vegetables and purée them in a blender or food processor, then return the purée to the pot to thicken the sauce. Season with salt and pepper. Serve the lamb shanks topped with the sauce, with mashed potatoes or creamy risotto